:root {
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, monospace;
  --accent: #397dd7;
  --accent2: #55c7bd;
}
body {
  display: block;
}
.notice {
  background: #302715;
  color: #f2d49b;
  border: 1px solid #66522a;
  border-radius: 7px;
  padding: 13px;
  font-size: 13px;
  line-height: 1.6;
}
.banner {
  margin: 20px 32px 0;
}
.content {
  padding: 26px 32px;
  max-width: 1450px;
}
h1 {
  font-size: 27px;
  margin-bottom: 8px;
}
h2 {
  font-size: 19px;
  margin: 10px 0 18px;
}
h3 {
  margin: 16px 0;
}
p {
  color: var(--text2);
  line-height: 1.65;
}
label {
  display: block;
  font-size: 13px;
  color: var(--text2);
  margin: 12px 0 5px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 11px;
  font: inherit;
  margin-top: 5px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent2);
  outline-offset: 1px;
}
button {
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 5px 5px 5px 0;
  font: inherit;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn:disabled {
  opacity: 0.5;
  cursor: wait;
}
.row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.row > label,
.row > div {
  flex: 1;
  min-width: 150px;
}
.card {
  padding: 22px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 20px 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.cards .card {
  margin: 18px 0;
}
.metric {
  font-size: 32px;
  margin: 12px 0;
  color: var(--text);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--text2);
  font-weight: 500;
}
td code {
  overflow-wrap: anywhere;
}
small {
  color: var(--text2);
}
.scroll {
  overflow: auto;
}
.badge {
  font-size: 11px;
  display: inline-block;
  background: #173c40;
  color: #96e4d7;
  padding: 5px 8px;
  border-radius: 4px;
}
.badge.bad {
  background: #462925;
  color: #f3b0a2;
}
#feedback {
  margin: 16px 32px 0;
  color: #94e4cc;
  white-space: pre-wrap;
}
#feedback.error,
#login-error {
  color: #ffc0b8;
}
.topbar select {
  min-width: 300px;
}
.topbar label {
  margin: 0;
}
.sidebar-logo small {
  display: block;
  font-size: 10px;
  line-height: 1.6;
  margin-top: 8px;
}
.empty {
  padding: 35px;
  text-align: center;
  color: var(--text2);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 14px 0;
}
.chat-answer {
  white-space: pre-wrap;
  line-height: 1.7;
  padding: 18px;
  background: var(--bg3);
  border-radius: 8px;
}
.item-row {
  display: grid;
  grid-template-columns: 1fr 3fr 1fr 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}
.item-row label {
  min-width: 0;
}
dialog {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 900px;
  width: 92%;
  max-height: 90vh;
  padding: 26px;
  margin: auto;
}
dialog::backdrop {
  background: #000a;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg);
  padding: 15px;
  border-radius: 7px;
  font-size: 12px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent2);
}
[hidden] {
  display: none !important;
}
@media (max-width: 800px) {
  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
  }
  .sidebar-logo {
    padding: 15px;
  }
  .sidebar-footer {
    display: none;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    padding: 4px;
  }
  .sidebar nav a {
    min-width: max-content;
    padding: 10px;
  }
  .main {
    margin-left: 0;
  }
  .topbar {
    padding: 14px;
    position: static;
    gap: 10px;
    flex-wrap: wrap;
  }
  .topbar select {
    min-width: 220px;
  }
  .content {
    padding: 18px;
  }
  .banner,
  #feedback {
    margin: 14px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .cards .card {
    margin: 5px 0;
  }
  .item-row {
    grid-template-columns: 1fr 1fr;
  }
}
.agent-panel {
  margin: 1rem 2rem;
  padding: 1.4rem;
  border: 1px solid #324b6e;
  border-radius: 14px;
  background: var(--bg2);
  color: var(--text);
}
.agent-panel h2 {
  margin-top: 0;
}
.agent-panel textarea {
  width: 100%;
  min-height: 72px;
}
.chat-log {
  white-space: pre-wrap;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  background: var(--bg3);
  color: var(--text);
  border-radius: 8px;
  margin: 10px 0;
}
.pending-field {
  border-color: #bb7900 !important;
  background: #302715 !important;
  color: #f2d49b !important;
}
.proposal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.proposal-grid input,
.proposal-grid select {
  width: 100%;
}
.review-result {
  white-space: pre-wrap;
}
.agent-panel button:disabled {
  opacity: 0.5;
}
@media (max-width: 650px) {
  .agent-panel {
    margin: 10px;
  }
  .proposal-grid {
    grid-template-columns: 1fr;
  }
}

input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin-right: 8px;
}

/* Login branding only: no changes to internal module layouts. */
.login-panel {
  width: min(960px, calc(100% - 48px));
  margin: max(40px, 9vh) auto;
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  border: 1px solid #2b3946;
  border-radius: 22px;
  overflow: hidden;
  background: #131b25;
  box-shadow: 0 24px 70px #0003;
}
.login-intro {
  padding: 52px 44px;
  background: linear-gradient(145deg, #172b35, #111d28 80%);
  display: flex;
  flex-direction: column;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 17px;
}
.brand-name {
  color: #f2f7fa;
  font-size: 32px;
  font-weight: 750;
  letter-spacing: 0.065em;
  line-height: 1.1;
}
.brand-name span {
  color: #8be3d8;
  font-weight: 500;
}
.login-panel .brand-description {
  font-size: 14px;
  color: #b5c9d1;
  margin: 22px 0 40px;
  line-height: 1.6;
  max-width: 290px;
}
.login-panel h1 {
  color: #f2f7fa;
  font-size: clamp(25px, 2.6vw, 32px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
}
.login-panel .login-support {
  font-size: 15px;
  line-height: 1.75;
  color: #afc0cc;
  margin: 0 0 38px;
  max-width: 320px;
}
.login-company {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid #30414d;
  font-size: 12px;
  color: #aac0cb;
}
.login-access {
  padding: 52px 40px 34px;
}
.private-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #91d7cc;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.15em;
  margin-bottom: 20px;
}
.private-label span {
  font-size: 8px;
}
.login-access h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #f2f7fa;
  margin: 0 0 9px;
}
.login-panel .login-instructions {
  color: #afbdcc;
  font-size: 14px;
  margin: 0 0 26px;
  line-height: 1.6;
}
#login-form label {
  margin: 20px 0 8px;
  font-size: 13px;
  font-weight: 550;
  color: #d4e0eb;
}
#login-form input {
  background: #0e1620;
  border-color: #3d5062;
  color: #f3f7fa;
  border-radius: 8px;
  padding: 13px 14px;
  min-height: 48px;
  font-size: 16px;
  margin: 0;
}
#login-form input::placeholder {
  color: #91a1b2;
  opacity: 1;
}
#login-form input:focus {
  border-color: #80dacc;
  outline: 2px solid #80dacc;
  outline-offset: 2px;
}
#login-form .btn-primary {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 26px 0 0;
  padding: 13px;
  border: 1px solid #81ded1;
  border-radius: 8px;
  background: #81ded1;
  color: #102a30;
  font-size: 15px;
  font-weight: 700;
}
#login-form .btn-primary:hover {
  background: #a0ebdf;
}
#login-form .btn-primary:focus-visible {
  outline: 2px solid #e8fffa;
  outline-offset: 3px;
}
.login-panel #login-error {
  min-height: 21px;
  margin: 12px 0 8px;
  font-size: 13px;
  line-height: 1.5;
}
.login-notice {
  margin-top: 14px;
  padding: 14px 15px;
  background: #292619;
  border-color: #594c30;
  color: #e7d5ad;
}
.login-notice strong {
  display: block;
  font-size: 10px;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.login-notice span {
  font-size: 12px;
  line-height: 1.6;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
@media (max-width: 700px) {
  .login-panel {
    grid-template-columns: 1fr;
    width: min(470px, calc(100% - 32px));
    margin: 24px auto;
    border-radius: 18px;
  }
  .login-intro {
    padding: 30px 26px;
  }
  .login-brand img {
    width: 48px;
    height: 48px;
  }
  .brand-name {
    font-size: 27px;
  }
  .login-panel .brand-description {
    margin: 18px 0 24px;
  }
  .login-panel h1 {
    font-size: 27px;
  }
  .login-panel .login-support {
    margin-bottom: 23px;
  }
  .login-company {
    padding-top: 18px;
  }
  .login-access {
    padding: 30px 26px 24px;
  }
  .login-break {
    display: none;
  }
}

.assistant-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.assistant-examples .btn {
  color: #183c52;
  background: #f1f6f8;
  border-color: #a8bdc8;
  font-size: 0.9rem;
}
.badge.simulated {
  color: #74420a;
  background: #fff0cc;
  border: 1px solid #d6ae60;
}
#ai-model {
  color: #b8c8d8;
  font-size: 1rem;
  line-height: 1.5;
}
#registry {
  max-width: 100%;
}
@media (max-width: 600px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .topbar > div {
    min-width: 0;
    max-width: 100%;
  }
  .assistant-examples .btn {
    min-height: 44px;
    text-align: left;
  }
  .agent-panel {
    padding: 1rem;
  }
}

.badge.simulated {
  font-family: var(--sans);
  letter-spacing: 0;
  font-size: 12px;
  line-height: 1.4;
}

/* Conversation and product typography; business forms and calculations are unchanged. */
body {
  font-size: 16px;
}
#shell nav a {
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0;
}
#shell label,
#shell small,
#shell th,
#shell .badge {
  font-size: 14px;
}
#shell th,
#shell small {
  text-transform: none;
  letter-spacing: 0;
}
#shell table,
#shell .btn,
#shell input,
#shell select,
#shell textarea {
  font-size: 16px;
}
#shell h1 {
  font-size: 24px;
}
#shell h2 {
  font-size: 22px;
}
#shell h3 {
  font-size: 20px;
}
#shell .sidebar-footer {
  color: var(--text2);
  font-size: 14px;
}
#shell .sidebar-logo p {
  font-size: 14px;
}
.agent-panel {
  max-width: 1050px;
  margin: 24px auto;
  padding: 0;
  border-color: #334452;
}
.chat-header {
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.chat-header h2 {
  margin: 0 0 8px;
}
.chat-header p {
  margin: 0;
}
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: clamp(240px, 38dvh, 420px);
  max-height: none;
  padding: 24px;
  margin: 0;
  border-radius: 0;
  background: #10171c;
  white-space: normal;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.chat-welcome {
  margin: auto;
  text-align: center;
  color: #b8c8d8;
}
.chat-message {
  max-width: 82%;
  padding: 14px 18px;
  border-radius: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}
.chat-user {
  align-self: flex-end;
  background: #214c49;
  color: #f0faf8;
  border-bottom-right-radius: 4px;
}
.chat-assistant {
  align-self: flex-start;
  background: #24313b;
  color: #edf3f8;
  border-bottom-left-radius: 4px;
}
.chat-status {
  min-height: 28px;
  padding: 4px 24px;
  color: #b8c8d8;
  font-size: 14px;
}
.assistant-examples {
  margin: 0;
  padding: 8px 24px;
}
.assistant-examples .btn {
  background: #1c2b34;
  border-color: #435d6c;
  color: #d8e7ee;
  min-height: 44px;
}
.chat-options {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px 12px;
  flex-wrap: wrap;
}
.chat-options label {
  margin-top: 0;
}
.chat-options > label {
  flex: 1;
}
.chat-attachment {
  flex: 1;
  min-width: 180px;
}
.chat-attachment summary {
  cursor: pointer;
  padding: 12px 0;
}
.chat-attachment[open] {
  flex-basis: 100%;
}
.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 14px 24px 20px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}
.message-label {
  grid-column: 1 / -1;
  margin: 0;
}
.agent-panel .chat-composer textarea {
  margin: 0;
  min-height: 56px;
  max-height: 160px;
  resize: vertical;
}
.chat-composer .btn {
  min-height: 56px;
}
.manual-toggle {
  margin: 20px 24px;
}
#workbench {
  margin: 0 24px 24px;
}
.chat-result {
  align-self: flex-start;
  width: min(100%, 550px);
  padding: 18px;
  border-radius: 12px;
  background: #1a2730;
  border: 1px solid #52736e;
}
.chat-result h3 {
  margin: 0 0 16px;
}
.chat-result dl {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 2fr;
  gap: 8px 16px;
}
.chat-result dt {
  color: #b8c8d8;
}
.chat-result dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.chat-result p {
  margin: 14px 0;
}
.chat-result .proposal-pending {
  color: #f2d49b;
}
.chat-result .btn {
  white-space: normal;
}
@media (max-width: 1300px) {
  .agent-panel {
    margin: 20px 24px;
  }
}
@media (max-width: 650px) {
  .agent-panel {
    margin: 16px 10px;
  }
  .chat-header,
  .chat-log {
    padding: 16px;
  }
  .chat-message {
    max-width: 92%;
    padding: 12px 14px;
  }
  .chat-options,
  .assistant-examples {
    padding-left: 16px;
    padding-right: 16px;
  }
  .chat-composer {
    padding: 12px 16px 16px;
  }
  .manual-toggle {
    margin: 16px;
  }
  #workbench {
    margin: 0 16px 16px;
  }
  .chat-result {
    padding: 14px;
  }
  .chat-result dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .chat-result dd {
    margin-bottom: 8px;
  }
}

/* Keep the composer in reach while reading the conversation. */
.conversation {
  position: relative;
}
.chat-composer {
  position: sticky;
  bottom: 0;
  z-index: 2;
}
@media (max-width: 650px) {
  .chat-options {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .chat-attachment {
    min-width: 0;
  }
}
