/* Hallmark · macrostructure: Workbench · genre: modern-minimal · theme: Cobalt
 * audience: administradores de correo · use: reconstruir el recorrido de un mensaje
 * pre-emit critique: philosophy 5 · hierarchy 5 · execution 4 · specificity 5 · restraint 4 · variety 5
 */
:root {
  --bg: #0b1420;
  --bg-deep: #07101a;
  --surface: #111e2c;
  --surface-raised: #17283a;
  --surface-soft: #0f1a28;
  --ink: #edf2e8;
  --muted: #91a3b4;
  --faint: #607486;
  --line: #24384b;
  --line-bright: #36546a;
  --accent: #b8f36b;
  --accent-soft: #243c2a;
  --cyan: #6ed5d2;
  --orange: #ffb36b;
  --red: #ff7f7f;
  --purple: #ba9cff;
  --font-display: Georgia, "Times New Roman", serif;
  --font-ui: "Trebuchet MS", "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 16px;
  --shadow: #03091199;
}

html, body { overflow-x: clip; }
* { box-sizing: border-box; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(var(--grid-line, #152434) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line, #152434) 1px, transparent 1px),
    radial-gradient(circle at 12% -10%, #15344a, transparent 34rem),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto, auto;
  font-family: var(--font-ui);
  line-height: 1.45;
}
body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: linear-gradient(115deg, transparent 0 48%, #b8f36b08 48.1% 48.25%, transparent 48.4%);
  content: "";
  pointer-events: none;
}
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 42px; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}
.brand, .masthead-meta, .section-index, .system-label, .confidence, .panel-hint, .page-footer, .field-help {
  font-family: var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: .76rem;
  font-weight: 800;
  text-decoration: none;
}
.brand-mark { display: inline-flex; align-items: end; gap: 3px; height: 18px; }
.brand-mark i { display: block; width: 4px; border-radius: 2px; background: var(--accent); }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 15px; background: var(--cyan); }
.brand-mark i:nth-child(3) { height: 12px; background: var(--orange); }
.masthead-meta { display: inline-flex; align-items: center; gap: 10px; color: var(--faint); font-size: .62rem; }
.meta-divider { width: 28px; height: 1px; background: var(--line-bright); }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.intro-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 56px;
  align-items: end;
  padding: 86px 0 62px;
}
.eyebrow, .section-index { margin: 0 0 14px; color: var(--cyan); font-size: .68rem; }
h1, h2, p { margin-top: 0; }
h1 {
  max-width: 780px;
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: .92;
}
h2 { margin-bottom: 0; font-size: 1.25rem; letter-spacing: -.02em; }
.lede { max-width: 650px; margin-bottom: 0; color: var(--muted); font-size: 1.02rem; }
.system-card { display: grid; gap: 12px; padding: 18px; border-left: 2px solid var(--accent); background: var(--surface-soft); }
.system-label { color: var(--faint); font-size: .62rem; }
.system-card strong { display: flex; align-items: center; gap: 11px; font-size: .92rem; }
.system-note { color: var(--muted); font-size: .75rem; }

.search-panel, .results-panel, .trace-callout {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(140deg, var(--surface), var(--surface-soft));
  box-shadow: 0 24px 65px var(--shadow);
}
.search-panel { padding: 24px; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.panel-heading .section-index { margin-bottom: 7px; }
.panel-hint { color: var(--faint); font-size: .6rem; }
.search-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label { display: grid; min-width: 0; gap: 7px; color: var(--muted); font-size: .82rem; }
.field-label { color: var(--muted); }
.field-help { color: var(--faint); font-size: .58rem; letter-spacing: .02em; text-transform: none; }
input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--bg-deep);
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input::placeholder { color: var(--faint); }
input:hover { border-color: var(--line-bright); background: var(--surface-soft); }
input:focus-visible { border-color: var(--cyan); box-shadow: 0 0 0 3px #6ed5d226; }
input:disabled { cursor: not-allowed; opacity: .48; }

.date-input-wrap { display: block; position: relative; }
.date-display { padding-right: 54px; cursor: pointer; }
.date-display.has-value { color: var(--ink); font-family: var(--font-mono); font-size: .78rem; }
.date-trigger { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-raised); color: var(--cyan); cursor: pointer; }
.date-trigger:hover, .date-trigger:focus-visible { border-color: var(--cyan); background: #6ed5d21a; outline: 0; }
.calendar-glyph { display: block; position: relative; width: 14px; height: 13px; margin: auto; border: 1px solid currentColor; border-radius: 3px; }
.calendar-glyph::before { position: absolute; top: 3px; left: 1px; right: 1px; border-top: 1px solid currentColor; content: ""; }
.calendar-glyph::after { position: absolute; top: -3px; left: 3px; width: 5px; height: 4px; border-right: 1px solid currentColor; border-left: 1px solid currentColor; content: ""; }
.date-popover { position: absolute; z-index: 30; top: calc(100% + 10px); left: 0; width: min(344px, calc(100vw - 40px)); padding: 14px; border: 1px solid var(--line-bright); border-radius: 14px; background: var(--surface-raised); box-shadow: 0 24px 55px var(--shadow); animation: date-pop-in .16s ease-out; }
.date-popover[hidden] { display: none; }
.date-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.date-month-label { color: var(--ink); font-weight: 800; }
.date-month-label small { display: block; margin-top: 3px; color: var(--faint); font-family: var(--font-mono); font-size: .58rem; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.date-nav { display: flex; gap: 5px; }
.date-nav button, .date-calendar-foot button { min-width: 31px; min-height: 30px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--ink); cursor: pointer; }
.date-nav button:hover, .date-calendar-foot button:hover, .date-nav button:focus-visible, .date-calendar-foot button:focus-visible { border-color: var(--cyan); outline: 0; }
.date-weekdays, .date-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.date-weekdays { margin-bottom: 6px; color: var(--faint); font-family: var(--font-mono); font-size: .62rem; text-align: center; text-transform: uppercase; }
.date-day { min-height: 34px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); cursor: pointer; font-size: .78rem; }
.date-day:hover, .date-day:focus-visible { border-color: var(--cyan); background: #6ed5d21a; outline: 0; }
.date-day.is-outside { color: var(--faint); opacity: .5; }
.date-day.is-today { border-color: var(--accent); color: var(--accent); }
.date-day.is-selected { border-color: var(--accent); background: var(--accent); color: var(--bg-deep); font-weight: 800; }
.date-calendar-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.date-calendar-foot button { color: var(--cyan); font-family: var(--font-mono); font-size: .62rem; }
@keyframes date-pop-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.search-actions { display: flex; align-items: center; gap: 14px; grid-column: span 2; padding-top: 6px; }
button { border: 0; }
.primary-button { display: inline-flex; align-items: center; gap: 20px; min-height: 46px; padding: 0 16px 0 18px; border-radius: 9px; background: var(--accent); color: var(--bg-deep); cursor: pointer; font-weight: 800; }
.primary-button b { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--bg-deep); color: var(--accent); font-size: 1rem; }
.primary-button:hover { background: var(--ink); transform: translateY(-1px); }
.primary-button:focus-visible, .outline-button:focus-visible, .table-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.action-note { color: var(--faint); font-family: var(--font-mono); font-size: .61rem; }

.trace-callout { margin-top: 18px; padding: 22px 24px 0; border-color: var(--accent); }
.callout-topline, .results-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.callout-topline .section-index { margin-bottom: 0; }
.confidence { padding: 6px 9px; border: 1px solid var(--line-bright); border-radius: 999px; color: var(--muted); font-size: .58rem; }
.callout-content { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 18px 0 24px; }
.callout-content h2 { margin-bottom: 8px; }
.callout-content p { max-width: 720px; margin-bottom: 0; color: var(--muted); }
.outline-button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 18px; padding: 10px 13px; border: 1px solid var(--line-bright); border-radius: 8px; color: var(--ink); font-family: var(--font-mono); font-size: .65rem; text-decoration: none; }
.outline-button:hover { border-color: var(--cyan); color: var(--cyan); }
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 -24px; border-top: 1px solid var(--line); }
.summary-strip > div { display: grid; gap: 5px; min-width: 0; padding: 14px 18px 16px; border-right: 1px solid var(--line); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span { color: var(--faint); font-family: var(--font-mono); font-size: .58rem; text-transform: uppercase; }
.summary-strip strong { overflow-wrap: anywhere; font-size: .85rem; }
.status-value { color: var(--accent); }

.results-panel { margin-top: 18px; padding: 22px 24px 0; }
.results-heading { margin-bottom: 18px; }
.results-heading .section-index { margin-bottom: 7px; }
.result-count { color: var(--accent); font-family: var(--font-display); font-size: 1.8rem; line-height: 1; }
.result-count small { color: var(--muted); font-family: var(--font-mono); font-size: .58rem; letter-spacing: .05em; text-transform: uppercase; }
.table-wrap { overflow-x: auto; margin: 0 -24px; }
table { width: 100%; min-width: 900px; border-collapse: collapse; }
th, td { padding: 13px 11px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--faint); font-family: var(--font-mono); font-size: .6rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; }
td { color: var(--muted); font-size: .78rem; }
tbody tr:hover { background: #6ed5d208; }
.mono { font-family: var(--font-mono); font-size: .68rem; }
.nowrap { white-space: nowrap; }
.server-tag { color: var(--cyan); font-family: var(--font-mono); font-size: .68rem; }
.status-pill { display: inline-block; padding: 4px 8px; border: 1px solid var(--line-bright); border-radius: 999px; color: var(--muted); font-family: var(--font-mono); font-size: .62rem; }
.status-delivered { border-color: var(--accent); color: var(--accent); }
.status-relayed, .status-queued, .status-received { border-color: var(--cyan); color: var(--cyan); }
.status-deferred { border-color: var(--orange); color: var(--orange); }
.status-bounced, .status-rejected, .status-expired { border-color: var(--red); color: var(--red); }
.response-cell { max-width: 230px; color: var(--ink); }
.table-link { color: var(--cyan); font-family: var(--font-mono); font-size: .65rem; text-decoration: none; white-space: nowrap; }
.table-link:hover { color: var(--accent); }
.empty-state { display: grid; justify-items: start; gap: 5px; padding: 48px 11px 52px; border-top: 0; }
.empty-state strong { color: var(--ink); font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; }
.empty-state > span:last-child { color: var(--muted); }
.empty-glyph { color: var(--accent); font-family: var(--font-display); font-size: 2.8rem; line-height: .8; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; padding-top: 24px; color: var(--faint); font-size: .56rem; }

/* Trace page */
.trace-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 70px 0 34px; }
.trace-header h1 { margin-bottom: 0; font-size: clamp(2.7rem, 6vw, 5.2rem); }
.back-link { color: var(--cyan); font-family: var(--font-mono); font-size: .68rem; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.trace-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.trace-summary > div { display: grid; gap: 7px; min-height: 95px; padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trace-summary > div:nth-child(4n) { border-right: 0; }
.trace-summary span { color: var(--faint); font-family: var(--font-mono); font-size: .6rem; text-transform: uppercase; }
.trace-summary strong { overflow-wrap: anywhere; font-size: .84rem; }
.trace-explanation { margin: 22px 0 0; padding: 18px; border-left: 2px solid var(--accent); background: var(--surface-soft); color: var(--muted); }
.timeline-panel { margin-top: 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.timeline { display: grid; gap: 0; margin-top: 22px; }
.timeline-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; min-height: 112px; }
.timeline-marker { position: relative; display: flex; justify-content: center; }
.timeline-marker::before { position: absolute; top: 13px; bottom: -1px; width: 1px; background: var(--line-bright); content: ""; }
.timeline-item:last-child .timeline-marker::before { display: none; }
.dot { position: relative; z-index: 1; width: 12px; height: 12px; margin-top: 7px; border: 3px solid var(--surface); border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.timeline-card { padding: 0 0 22px; }
.timeline-time { margin: 0 0 5px; color: var(--faint); font-family: var(--font-mono); font-size: .64rem; }
.timeline-title { margin: 0 0 5px; color: var(--ink); font-size: .9rem; }
.timeline-details { margin: 0; color: var(--muted); font-family: var(--font-mono); font-size: .66rem; overflow-wrap: anywhere; }
.muted { color: var(--muted); }

@media (max-width: 860px) {
  .shell { width: min(100% - 30px, 680px); }
  .masthead-meta .meta-divider, .masthead-meta span:last-child { display: none; }
  .intro-block { grid-template-columns: 1fr; gap: 28px; padding: 62px 0 42px; }
  .system-card { max-width: 360px; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip > div:nth-child(2) { border-right: 0; }
  .callout-content { align-items: start; flex-direction: column; }
  .trace-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trace-summary > div:nth-child(2n) { border-right: 0; }
  .trace-summary > div:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 22px, 420px); padding-top: 14px; }
  .masthead-meta { font-size: .55rem; }
  h1 { font-size: clamp(2.7rem, 15vw, 4.2rem); }
  .search-panel, .results-panel, .trace-callout, .timeline-panel { padding-left: 15px; padding-right: 15px; }
  .search-grid { grid-template-columns: 1fr; }
  .search-actions { grid-column: span 1; align-items: start; flex-direction: column; }
  .summary-strip { margin-left: -15px; margin-right: -15px; }
  .summary-strip > div { padding-left: 15px; padding-right: 15px; }
  .panel-hint { display: none; }
  .page-footer { align-items: start; flex-direction: column; }
  .trace-header { align-items: start; flex-direction: column-reverse; gap: 18px; padding-top: 50px; }
  .trace-summary { grid-template-columns: 1fr; }
  .trace-summary > div, .trace-summary > div:nth-child(2n) { border-right: 0; }
  .trace-summary > div:last-child { border-bottom: 0; }
}
