/* Free tools: layout on top of ../assets/site.css (shared colours and type). */
.tool-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .5rem;
  padding: 1rem 0 0;
}
.tool-nav a {
  padding: .3rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 650;
  font-size: .92rem;
  text-decoration: none;
}
.tool-nav a[aria-current="page"] {
  border-color: var(--teal);
  background: var(--mint);
  color: var(--teal-dark);
}
.tool-main > * {
  max-width: 920px;
}
.tool-main {
  padding: 2rem 0 4rem;
}
.tool-main h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  max-width: none;
}
.tool-main h2 {
  font-size: 1.35rem;
  letter-spacing: -.01em;
}
.tool-main .card h2 {
  font-size: 1.15rem;
  margin-bottom: .4rem;
}
.lead {
  font-size: 1.1rem;
  color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.card,
.step-card,
.result {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}
a.card {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.card:hover,
a.card:focus-visible {
  border-color: var(--teal);
}
label {
  display: block;
  font-weight: 650;
  margin: .9rem 0 .3rem;
}
input,
textarea,
select {
  width: 100%;
  padding: .7rem .8rem;
  border: 1px solid #9fb1ad;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 1px;
}
textarea {
  min-height: 9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
}
small {
  display: block;
  margin: .3rem 0 .6rem;
  color: var(--muted);
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.1rem;
}
.tool-main button {
  padding: .7rem 1.1rem;
  border: 0;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.tool-main button:hover {
  background: var(--teal-dark);
}
.tool-main button:disabled {
  background: #7f918d;
  cursor: not-allowed;
}
.tool-main button[aria-busy="true"] {
  background: var(--teal-dark);
  cursor: progress;
}
.tool-main form > button {
  margin-top: 1.1rem;
}
.result {
  margin-top: 1.25rem;
}
/* No empty placeholder box: the panel appears with the first result. */
.result:empty {
  display: none;
}
.result.shown {
  animation: result-in .18s ease-out;
}
@keyframes result-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .result.shown { animation: none; }
}
.result > :first-child { margin-top: 0; }
.result > :last-child { margin-bottom: 0; }
.ok { border-left: 5px solid #18794e; }
.bad { border-left: 5px solid var(--red); }
.unknown { border-left: 5px solid #9a6700; }
.result code,
.step-card code:not(.inline),
.tool-main pre {
  display: block;
  padding: .75rem;
  border-radius: 8px;
  background: #eef4f2;
  font-size: .9rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.scan {
  padding: 0;
  margin: 0 0 1rem;
}
.scan li {
  display: grid;
  grid-template-columns: 9rem 7.5rem 1fr;
  gap: .5rem;
  align-items: start;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line);
  list-style: none;
}
.pill {
  padding: .1rem .55rem;
  border-radius: 999px;
  text-align: center;
  font-size: .85rem;
  font-weight: 700;
}
.pill.present { background: #d8f3e6; color: #0e5a39; }
.pill.unknown { background: #fff1c2; color: #6b4a00; }
.pill.not-found { background: #f9d7d4; color: #7d1f1c; }
dl { margin: 0; }
dt { float: left; width: 8rem; font-weight: 700; }
dd { margin: 0 0 .4rem 9rem; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .scan li { grid-template-columns: 1fr auto; }
  .scan li > :last-child { grid-column: 1 / -1; }
  dt { float: none; width: auto; }
  dd { margin-left: 0; }
}

/* ---- Guided / Advanced tools ------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin: 1.5rem 0 1.25rem;
  padding: .35rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eef4f2;
}
.tool-main .mode-option {
  display: grid;
  gap: .15rem;
  padding: .65rem .9rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 650;
  text-align: left;
}
.tool-main .mode-option:hover { background: rgba(255, 255, 255, .6); }
.tool-main .mode-option span { color: var(--muted); font-size: .88rem; font-weight: 500; }
.tool-main .mode-option[aria-pressed="true"] {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(16, 42, 54, .12);
}
.tool-main .mode-option[aria-pressed="true"] strong { color: var(--teal-dark); }
.step-card { margin-top: 1.25rem; }
.step-card > :last-child { margin-bottom: 0; }
.step-head {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.step-head h2,
.step-card > h2 { margin: 0; font-size: 1.3rem; }
.step-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}
.step-intro,
.hint { color: var(--muted); }
.step-intro { margin: .6rem 0 0; }
.step-card h3 { margin: 1.5rem 0 .4rem; font-size: 1.05rem; }
.summary {
  padding: .75rem .9rem;
  border-radius: 10px;
  background: var(--mint);
}
.field { margin-top: .9rem; }
.field > label,
.field > .label {
  display: block;
  margin: 0 0 .3rem;
  font-weight: 650;
}
.field-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 1rem;
}
.domain-form .tool-actions { margin-top: 1rem; }
.help-list { padding-left: 1.2rem; }
.help-list li { margin: .35rem 0; }
code.inline {
  display: inline;
  padding: .05rem .35rem;
  border-radius: 5px;
  background: #eef4f2;
  font-size: .88em;
  overflow-wrap: anywhere;
}
.small-label {
  margin: 1rem 0 .3rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.tool-main .secondary {
  border: 1px solid var(--teal);
  background: var(--panel);
  color: var(--teal-dark);
}
.tool-main .secondary:hover { background: var(--mint); }
.tool-main .small-button { padding: .45rem .75rem; font-size: .88rem; }
/* Choice cards */
.choices { display: grid; gap: .6rem; }
.choice {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin: 0;
  padding: .8rem .95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-weight: 400;
  cursor: pointer;
}
.choice:hover { border-color: #9fb1ad; }
.choice:has(input:checked) {
  border-color: var(--teal);
  background: var(--mint);
  box-shadow: inset 0 0 0 1px var(--teal);
}
.choice input { width: auto; margin-top: .3rem; accent-color: var(--teal); }
.choice-body { display: grid; gap: .15rem; }
.choice-body span { color: var(--muted); }
.badge {
  margin-left: .5rem;
  padding: .05rem .5rem;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: .75rem;
  font-weight: 750;
  vertical-align: .1em;
}
.badge:empty { display: none; }
.choice-body .badge { color: #fff; } /* beat .choice-body span's muted colour */
/* Lists of report destinations / SPF terms */
.dest-list { margin: .5rem 0; padding: 0; list-style: none; }
.dest-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .5rem;
  align-items: center;
  margin-bottom: .5rem;
}
.dest-list li.empty { display: block; color: var(--muted); font-style: italic; }
.dest-list .term { display: grid; gap: .15rem; }
.dest-list .term small { margin: 0; }
.dest-list.terms li { grid-template-columns: minmax(0, 1fr) auto; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.dest-status:empty { display: none; }
.add-row { display: flex; gap: .5rem; margin-top: .5rem; }
.checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .4rem .75rem;
}
.check {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  margin: 0;
  padding: .5rem .6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
.check:has(input:checked) { border-color: var(--teal); background: var(--mint); }
.check input { width: auto; margin-top: .25rem; accent-color: var(--teal); }
.check small { margin: 0; font-weight: 400; overflow-wrap: anywhere; }
details.more {
  margin-top: 1.5rem;
  padding: .2rem 0 0;
  border-top: 1px solid var(--line);
}
details.more > summary {
  padding: .75rem 0 .25rem;
  color: var(--teal-dark);
  font-weight: 700;
  cursor: pointer;
}
/* Explanations */
dl.explain {
  display: grid;
  grid-template-columns: minmax(6rem, 15rem) minmax(0, 1fr);
  gap: .6rem 1rem;
  margin: 1rem 0;
}
dl.explain dt { float: none; width: auto; min-width: 0; overflow-wrap: anywhere; }
dl.explain dt code.inline { word-break: break-all; }
dl.explain dd { margin: 0; }
dl.explain dd.tone-good { color: #0e5a39; }
dl.explain dd.tone-warn { color: #6b4a00; }
dl.explain dd.tone-bad { color: #7d1f1c; font-weight: 600; }
.notice {
  margin: 1rem 0;
  padding: .75rem .95rem;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 10px;
  background: #fbfdfc;
}
.notice > strong { display: block; margin-bottom: .2rem; }
.notice p { margin: .25rem 0; }
.notice ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.notice.ok { border-left-color: #18794e; }
.notice.warn { border-left-color: #c58a00; background: #fffcf2; }
.notice.bad { border-left-color: var(--red); background: #fff7f6; }
.notice.info { border-left-color: var(--teal); }
ul.changes { padding-left: 1.2rem; }
/* Publish table */
table.publish {
  width: 100%;
  /* The site-wide 680px table minimum is for data tables in a .table-wrap
     scroller; this one has no scroller and must fit a 400px screen. */
  min-width: 0;
  margin: 1rem 0;
  border-collapse: collapse;
}
table.publish th,
table.publish td {
  padding: .6rem .5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
table.publish th { width: 9.5rem; color: var(--muted); font-weight: 650; }
table.publish td code { margin: 0; overflow-wrap: anywhere; }
.cell-action { margin-top: .4rem; }
.how-to ol { padding-left: 1.2rem; }
.how-to li { margin: .35rem 0; }
.live-check { margin-top: 1.25rem; }
.scan .what { display: block; color: var(--muted); font-size: .92rem; }
.scan li > span { overflow-wrap: anywhere; }
ol.hops { padding-left: 1.4rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
ol.hops li { margin: .35rem 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .mode-switch { grid-template-columns: 1fr; }
  .dest-list li { grid-template-columns: 1fr auto; }
  .dest-list li .dest-status { grid-row: 2; }
  dl.explain { grid-template-columns: 1fr; gap: .15rem; }
  dl.explain dd { margin-bottom: .6rem; }
  table.publish th { width: 6.5rem; }
}
/* "Use DMARC Monitor" prompt in the DMARC tool and the scan. */
.subscribe {
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px solid #b9d8d2;
  border-radius: 14px;
  background: var(--mint);
}
.subscribe > strong { display: block; font-size: 1.05rem; }
.subscribe p { margin: .35rem 0; }
.subscribe .actions { margin-top: .75rem; }
