* {
  box-sizing: border-box;
}
html {
  font-size: 15px;
}
body {
  margin: 0;
  --shell: #000f30;
  --bg: #00133d;
  --panel: #001b52;
  --alt: #002060;
  --border: #214682;
  --text: #fff;
  --muted: #bdcce4;
  --accent: #ff6600;
  --link: #afceff;
  --field: #001644;
  background: var(--bg);
  color: var(--text);
  font:
    500 1rem/1.46 "Quicksand",
    Calibri,
    Arial,
    sans-serif;
}
body[data-theme="light"],
.agent,
.preview-paper {
  --bg: #f4f6fa;
  --panel: #fff;
  --alt: #f1f4f9;
  --border: #c9d2e0;
  --text: #182945;
  --muted: #50617a;
  --link: #003399;
  --field: #fff;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 1.08rem;
}
h3 {
  font-size: 1rem;
}
a {
  color: var(--link);
  text-underline-offset: 3px;
}
button,
.button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 0.36rem;
  padding: 0.46rem 0.85rem;
  min-height: 2.35rem;
  background: var(--alt);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.9rem;
}
button:hover,
.button:hover {
  filter: brightness(1.12);
  border-color: #6694d4;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.primary {
  background: #ff6600;
  color: #231500;
  border-color: #ff6600;
}
.quiet {
  background: transparent;
}
.muted,
small,
.subhead {
  color: var(--muted);
}
small {
  display: block;
  font-size: 0.85rem;
}
input,
select,
textarea {
  width: 100%;
  padding: 0.53rem 0.67rem;
  min-height: 2.45rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  background: var(--field);
  color: var(--text);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
textarea {
  min-height: 5rem;
  resize: vertical;
}
label {
  display: grid;
  gap: 0.36rem;
  font-size: 0.87rem;
  font-weight: 650;
}
label.check {
  display: flex;
  align-items: center;
}
.check input {
  width: auto;
  min-height: 0;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[contenteditable]:focus-visible {
  outline: 3px solid #ff893d;
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.app-shell-header,
.agent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--shell);
  color: white;
  border-bottom: 3px solid var(--accent);
  padding: 0.95rem 1.6rem;
}
.brand-home {
  text-decoration: none;
  color: white;
}
.brand-lockup {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem;
  line-height: 1;
}
.brand-wordmark {
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.brand-mci,
.small-mark {
  color: #ff6600;
}
.brand-bpo {
  color: #2f70d9;
}
.app-title {
  font-size: clamp(1.05rem, 2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}
.settings,
.agent-head details {
  position: relative;
}
.settings summary,
summary {
  cursor: pointer;
  font-weight: 650;
}
.settings > div,
.agent-head nav {
  position: absolute;
  z-index: 5;
  right: 0;
  min-width: 12rem;
  display: grid;
  gap: 0.4rem;
  padding: 0.8rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  box-shadow: 0 0.5rem 1.5rem #0003;
}
.settings button {
  width: 100%;
}
.app-shell {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  min-height: calc(100dvh - 65px);
}
.rail {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1.6rem 1rem;
}
.rail-label,
.eyebrow,
.paper-meta,
.subhead {
  font-size: 0.74rem;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.rail select {
  margin: 0.5rem 0 1.4rem;
}
.rail nav {
  display: grid;
  gap: 0.3rem;
}
.rail nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0.25rem;
  font-weight: 650;
}
.rail nav a span {
  width: 1.25rem;
  text-align: center;
  font: 1.2rem Arial;
}
.rail nav a.active,
.rail nav a:hover {
  color: var(--text);
  background: var(--alt);
  border-left-color: var(--accent);
}
.workspace {
  width: 100%;
  max-width: 108rem;
  margin: 0 auto;
  padding: clamp(1.15rem, 2.5vw, 2.6rem);
}
.page-head,
.section-heading,
.panel-head,
.list-row,
.actions,
.pager {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.page-head,
.section-heading,
.panel-head,
.list-row {
  justify-content: space-between;
}
.page-head {
  margin-bottom: 1.55rem;
}
.page-head .eyebrow,
.back {
  display: block;
  margin-bottom: 0.35rem;
}
.section-heading {
  margin-bottom: 0.6rem;
}
.section-heading > span,
.panel-head > span,
.list-row > span,
.back {
  font-size: 0.88rem;
}
.panel,
.inline-panel,
.filters,
.metrics > div {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.48rem;
}
.panel {
  margin: 1rem 0;
  overflow: clip;
}
.panel-head {
  padding: 0.72rem 1rem;
  background: #000f30;
  color: white;
  border-bottom: 3px solid #ff6600;
}
.panel-head a {
  color: #d4e4ff;
}
.panel-head input {
  max-width: 16rem;
}
.panel-head button {
  background: #002060;
  border-color: #41659c;
  color: white;
}
.pad,
.inline-panel,
.filters,
.empty {
  padding: 1.1rem;
}
.list-row {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  overflow-wrap: anywhere;
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row > span,
.empty p,
.section-heading > span {
  color: var(--muted);
}
.list-row a,
.back {
  text-decoration: none;
}
.list-row > a:hover,
.back:hover {
  text-decoration: underline;
}
.empty {
  padding: 2rem 1.2rem;
}
.empty p {
  margin-top: 0.4rem;
}
.inline-panel,
.filters,
.actions,
.pager,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.inline-panel,
.filters {
  align-items: end;
}
.inline-panel label,
.filters label {
  min-width: 9rem;
  flex: 1;
}
.filters label {
  max-width: 14rem;
}
.metrics,
.form-grid,
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.8rem;
}
.metrics > div {
  padding: 1rem;
}
.metrics strong {
  display: block;
  font-size: 2rem;
  color: var(--text);
}
.metrics span {
  color: var(--muted);
  font-weight: 650;
}
.badge {
  border-radius: 1rem;
  background: #214682;
  color: white;
  padding: 0.15rem 0.65rem;
  font-size: 0.8rem;
}
.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  align-items: end;
}
.pad > label,
.properties label,
.advanced {
  margin: 0.75rem 0;
}
.error,
.success,
#call-message:not(:empty) {
  padding: 0.7rem 1rem;
  margin: 0.75rem 0;
  border-radius: 0.35rem;
  background: #fff0e6;
  color: #672d00;
  border: 1px solid #fa9b54;
}
.success {
  background: #d6f3e3;
  color: #114d2e;
  border-color: #85c79c;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
td,
th {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--muted);
  background: var(--alt);
  white-space: nowrap;
}
.pager {
  justify-content: end;
  padding: 0.75rem;
}
.facts {
  padding: 1rem;
  margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
dt {
  color: var(--muted);
  font-size: 0.85rem;
}
dd {
  margin: 0.25rem 0;
  overflow-wrap: anywhere;
}
.chips {
  margin: 0.5rem 0;
}
.chips code {
  background: var(--alt);
  padding: 0.2rem 0.4rem;
}
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 1rem;
  align-items: start;
}
.editor-layout > .panel {
  margin: 0;
}
.title-input {
  padding: 1rem;
}
.title-input input {
  font-size: 1.2rem;
  font-weight: 700;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem 0.8rem;
  background: var(--alt);
  border-block: 1px solid var(--border);
}
.toolbar button {
  padding: 0.25rem 0.5rem;
  min-width: 2.1rem;
  min-height: 2rem;
}
.canvas,
.preview-paper,
.paper {
  background: white;
  color: #172743;
}
.canvas {
  min-height: 23rem;
}
.tiptap {
  min-height: 23rem;
  padding: 1.5rem;
  line-height: 1.65;
  outline: 0 !important;
}
.tiptap p,
article p {
  margin: 0.35em 0 0.75em;
}
.tiptap h2,
article h2 {
  font-size: 1.5rem;
}
.tiptap h3,
article h3 {
  font-size: 1.18rem;
}
.tiptap a,
article a {
  color: #003399;
}
.token-chip,
.caller-detail {
  background: #e5efff;
  color: #153c78;
  border-radius: 0.2rem;
  padding: 0.06rem 0.25rem;
}
.field-chip,
.condition-box {
  padding: 0.7rem 0.9rem;
  margin: 0.5rem 0;
  border: 1px solid #adc0d7;
  border-left: 3px solid #487abd;
  border-radius: 0.25rem;
  background: #f1f5fa;
}
.field-chip small,
.field-chip strong {
  display: block;
  color: #213957;
}
.condition-box:before {
  content: attr(data-caption);
  display: block;
  font-size: 0.8rem;
  color: #214682;
  font-weight: 700;
}
.ProseMirror-selectednode {
  outline: 2px solid #ff6600;
}
.tool-list,
.properties {
  display: grid;
  gap: 0.3rem;
}
.tool-list button {
  justify-content: start;
}
.selected {
  border-color: var(--accent);
}
.history,
.advanced {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border);
}
.history > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 0;
}
.route-card {
  background: var(--alt);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.9rem;
  margin: 0.6rem 0;
}
.route-card .subhead,
.route-card .actions {
  margin: 0.6rem 0;
}
.route-card select {
  max-width: 30rem;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: #0008;
  padding: 1rem;
}
.dialog {
  width: min(52rem, 100%);
  max-height: 90dvh;
  overflow: auto;
  background: var(--panel);
  border-radius: 0.5rem;
}
.preview-paper {
  padding: 1.4rem;
}
.answer {
  display: grid;
  gap: 0.35rem;
  margin: 1rem 0;
}
.answer b {
  color: #a34100;
}
.answer input,
.answer select,
.answer textarea {
  background: white;
  color: #162838;
  border: 1px solid #a4b3c8;
}
.public-main {
  min-height: 100dvh;
  background: linear-gradient(135deg, #002060, #000f30);
  color: white;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 3rem 1.15rem;
  gap: 1.5rem;
}
.public-main .brand-lockup {
  justify-content: center;
}
.login-card {
  width: min(100%, 27rem);
  padding: 1.8rem;
  background: #000f30;
  border: 1px solid #214682;
  border-radius: 0.5rem;
  box-shadow: 0 0.65rem 1.75rem #0004;
}
.login-card h1 {
  font-size: 1.55rem;
  border-bottom: 1px solid #214682;
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
}
.login-card label {
  color: white;
  margin: 0.75rem 0;
}
.login-card input {
  height: 2.85rem;
  min-height: 2.85rem;
  line-height: normal;
  background: #132141;
  color: white;
  border-color: #59667e;
}
.login-card button {
  width: 100%;
  margin-top: 0.65rem;
  min-height: 3.25rem;
}
.public-main small {
  color: white;
}
.agent {
  background: #f3f5f9;
  color: #182945;
}
.agent-head {
  justify-content: flex-start;
  padding: 0.65rem 1rem;
}
.agent-head details {
  margin-left: auto;
}
.agent-head nav {
  width: max-content;
  max-width: 88vw;
  background: white;
}
.script-link {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.paper {
  margin: 1.25rem auto;
  padding: clamp(1rem, 3vw, 2.25rem);
  max-width: 58rem;
  border: 1px solid #ccd4de;
  border-radius: 0.4rem;
}
.paper-meta {
  display: flex;
  justify-content: space-between;
  color: #556780;
}
.paper h1 {
  margin: 0.55rem 0 1.35rem;
}
.agent-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.6rem max(1rem, calc((100vw - 56rem) / 2));
  background: #fff;
  border-top: 1px solid #c9d2e0;
}
.agent-actions button {
  background: #ff6600;
  color: #231500;
}
.agent #call-message:not(:empty) {
  position: sticky;
  bottom: 3rem;
  max-width: 58rem;
  margin: 0.55rem auto;
}
.preview-paper h2 {
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 11rem minmax(0, 1fr);
  }
  .editor-layout {
    grid-template-columns: minmax(0, 1fr) 14rem;
  }
  .rail {
    padding: 1rem 0.6rem;
  }
}
@media (max-width: 720px) {
  .app-shell {
    display: block;
  }
  .rail {
    border: 0;
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--border);
  }
  .rail-label {
    display: none;
  }
  .rail select {
    width: auto;
    max-width: 100%;
    margin: 0 0 0.35rem;
  }
  .rail nav {
    display: flex;
    overflow: auto;
  }
  .rail nav a {
    white-space: nowrap;
    font-size: 0.86rem;
    padding: 0.35rem;
  }
  .rail nav a span {
    display: none;
  }
  .app-shell-header {
    padding: 0.75rem;
  }
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .page-head,
  .list-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .paper {
    margin: 0.5rem;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .brand-lockup {
    column-gap: 0.4rem;
  }
  .canvas,
  .tiptap {
    min-height: 16rem;
  }
}
