:root {
  --navy: #1f3a5f;
  --navy-deep: #16293f;
  --gold: #b08d57;
  --ink: #1b1f24;
  --muted: #5d6673;
  --line: #dfe3e8;
  --paper: #ffffff;
  --ground: #f4f5f7;
  --crit: #a32c2c;
  --high: #c2610c;
  --med: #7a6a1f;
  --low: #4a6b52;
  --radius: 6px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.55 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- visitor-facing chrome ---------- */

.site-head {
  background: var(--navy);
  color: #fff;
  padding: 22px 0;
  border-bottom: 3px solid var(--gold);
}
.site-head .brand { font-size: 22px; letter-spacing: 0.02em; margin: 0; }
.site-head .tagline { margin: 4px 0 0; font-size: 13px; opacity: 0.75; font-family: system-ui, sans-serif; }
.site-head a { color: #fff; text-decoration: none; }


main { padding: 34px 0 60px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 20px;
}

h1 { font-size: 28px; margin: 0 0 6px; font-weight: 600; }
h2 { font-size: 19px; margin: 0 0 12px; font-weight: 600; }
.lede { color: var(--muted); margin: 0 0 24px; font-size: 15px; }

/* ---------- forms ---------- */

label { display: block; font-family: system-ui, sans-serif; font-size: 13px; font-weight: 600; margin: 16px 0 5px; }
label .opt { font-weight: 400; color: var(--muted); }

input[type=text], input[type=email], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }

.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1 1 240px; min-width: 0; }

button, .btn {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { background: var(--navy-deep); }
button[disabled] { opacity: 0.55; cursor: progress; }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: rgba(31,58,95,0.07); color: var(--navy); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.actions { margin-top: 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hint { font-family: system-ui, sans-serif; font-size: 12.5px; color: var(--muted); }

/* ---------- acknowledgment ---------- */

.ack {
  border-left: 4px solid var(--gold);
  background: #fcfaf6;
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 24px;
}
.ack h1 { font-size: 22px; }
.ack p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.ack .elapsed {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--low);
  margin-top: 12px;
}

.q { margin-bottom: 18px; }
.q .qtext { font-family: system-ui, sans-serif; font-size: 14.5px; font-weight: 600; margin-bottom: 6px; display: block; }

/* ---------- staff console ---------- */

.console-head {
  background: #101822;
  color: #fff;
  padding: 14px 0;
  font-family: system-ui, -apple-system, sans-serif;
}
.console-head .wrap-wide { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.console-head .brand { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: 0.01em; }
.console-head .sub { font-size: 12px; opacity: 0.6; margin: 2px 0 0; }
.console-head a { color: rgba(255,255,255,0.8); font-size: 13px; text-decoration: none; }
.console-head a:hover { color: #fff; }
.console-actions { display: flex; gap: 14px; align-items: center; }

body.console { background: #eceef1; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
body.console h1, body.console h2 { font-family: inherit; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  flex: 1 1 150px;
}
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-top: 3px; }

.inbox { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.inbox-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 15px 18px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.inbox-row:first-child { border-top: none; }
.inbox-row:hover { background: #f7f9fb; }
.inbox-row.done { opacity: 0.6; }

.score {
  flex: 0 0 52px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.score .n { font-size: 21px; font-weight: 700; line-height: 1; }
.score .u { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em; margin-top: 3px; font-weight: 700; }
.u-critical { color: var(--crit); } .u-high { color: var(--high); }
.u-medium { color: var(--med); }   .u-low { color: var(--low); }

.inbox-main { flex: 1 1 auto; min-width: 0; }
.inbox-main .who { font-weight: 600; font-size: 14.5px; }
.inbox-main .who .co { font-weight: 400; color: var(--muted); }
.inbox-main .snip {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.inbox-meta { flex: 0 0 auto; text-align: right; font-size: 12px; color: var(--muted); }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: #eef1f5;
  color: #445;
  border: 1px solid var(--line);
  letter-spacing: 0.02em;
}
.tag-routed { background: #e8f1ea; color: var(--low); border-color: #cfe0d4; }
.tag-wait { background: #fdf3e6; color: var(--high); border-color: #f0ddc2; }

.detail-grid { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.detail-main { flex: 1 1 520px; min-width: 0; }
.detail-side { flex: 0 1 300px; min-width: 0; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-weight: 600; word-break: break-word; }

.quote {
  background: #f7f8fa;
  border-left: 3px solid var(--line);
  padding: 14px 18px;
  font-size: 14.5px;
  white-space: pre-wrap;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.qa { border-top: 1px solid var(--line); padding: 12px 0; }
.qa:first-of-type { border-top: none; }
.qa .qq { font-size: 13px; color: var(--muted); }
.qa .aa { font-size: 14.5px; margin-top: 3px; }

.banner {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14px;
  border: 1px solid;
}
.banner-ok { background: #edf5ef; border-color: #cbe0d1; color: #2c5238; }
.banner-err { background: #fdeeee; border-color: #f0cccc; color: var(--crit); }

pre.payload {
  background: #101822;
  color: #d6e0ea;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: 0;
}

.src {
  font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 6px;
  background: #fafbfc;
}

footer.demo-note {
  border-top: 1px solid var(--line);
  padding: 18px 0 40px;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: var(--muted);
}
footer.demo-note strong { color: #7a6a1f; }

table.spread { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.spread th, table.spread td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
table.spread th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

@media (max-width: 620px) {
  .inbox-meta { display: none; }
  .stats .stat { flex-basis: 45%; }
}

/* ---------- demo chrome: the only navigation, two real destinations ---------- */

.demo-bar {
  background: #0c1117;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}
.demo-bar .wrap-wide {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  min-height: 46px;
}
.demo-bar-id { display: flex; align-items: baseline; gap: 7px; font-size: 13px; }
.demo-bar-id .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #7ee787; align-self: center;
  box-shadow: 0 0 0 3px rgba(126,231,135,0.16);
}
.demo-bar-name { font-weight: 600; }
.demo-bar-by { font-size: 11.5px; color: rgba(255,255,255,0.45); }

.demo-tabs { display: flex; gap: 4px; margin-right: auto; }
.demo-tabs a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;
  padding: 13px 14px;
  border-bottom: 2px solid transparent;
}
.demo-tabs a:hover { color: #fff; }
.demo-tabs a.on { color: #fff; border-bottom-color: var(--gold); font-weight: 600; }

.demo-reset { margin: 0; }
.demo-reset button {
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.72);
  background: transparent;
}
.demo-reset button:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ---------- live-call narration ---------- */

.thinking { text-align: left; }
.thinking h2 { margin-bottom: 4px; }

.steps {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  font-family: system-ui, sans-serif;
  font-size: 14.5px;
}
.steps li {
  padding: 9px 0 9px 30px;
  position: relative;
  color: var(--muted);
  opacity: 0.45;
  transition: opacity 0.25s ease, color 0.25s ease;
}
.steps li::before {
  content: "";
  position: absolute;
  left: 6px; top: 50%;
  width: 8px; height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.steps li.active {
  opacity: 1;
  color: var(--navy);
  font-weight: 600;
}
.steps li.active::before {
  background: var(--navy);
  border-color: var(--navy);
  animation: pulse 1.1s ease-in-out infinite;
}
.steps li.done { opacity: 1; color: var(--low); }
.steps li.done::before {
  background: var(--low);
  border-color: var(--low);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31,58,95,0.35); }
  50%      { box-shadow: 0 0 0 5px rgba(31,58,95,0); }
}

@media (prefers-reduced-motion: reduce) {
  .steps li.active::before { animation: none; }
}

.elapsed-live {
  margin-top: 20px;
  font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- freshly submitted inquiry ---------- */

.fresh-note {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 14px;
}

.inbox-row.fresh {
  background: #fcfaf3;
  box-shadow: inset 3px 0 0 var(--gold);
}
.inbox-row.fresh:hover { background: #faf6ec; }

.just-in {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #8a6d2f;
  background: #f6ecd7;
  border: 1px solid #e6d6b4;
  border-radius: 3px;
  padding: 1px 5px;
  margin-right: 7px;
  vertical-align: 1px;
}
