* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f8;
  color: #20252b;
}

.topbar {
  background: #111827;
  color: white;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pilot {
  margin-left: 8px;
  font-size: 11px;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  padding: 3px 6px;
}

.user {
  font-size: 14px;
}

.user a {
  color: white;
  margin-left: 16px;
}

.role {
  margin-left: 5px;
  opacity: .7;
}

.nav {
  background: white;
  border-bottom: 1px solid #d9dee5;
  padding: 0 24px;
}

.nav a {
  display: inline-block;
  padding: 14px 15px;
  text-decoration: none;
  color: #303944;
  font-weight: 600;
}

.nav a:hover {
  background: #eef1f4;
}

.container {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 18px;
}

.card {
  background: white;
  border: 1px solid #dde2e7;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
}

h1, h2, h3 {
  margin-top: 0;
}

.meta {
  color: #667085;
  font-size: 14px;
}

.status {
  display: inline-block;
  border: 1px solid #cbd2d9;
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th, td {
  padding: 11px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

th {
  background: #f8fafc;
}

input, textarea, select {
  width: 100%;
  padding: 10px;
  margin: 5px 0 12px;
  border: 1px solid #cbd2d9;
  border-radius: 5px;
}

button {
  padding: 9px 15px;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.notice {
  background: white;
  border-left: 4px solid #667085;
  padding: 12px;
  margin-bottom: 16px;
}

footer {
  text-align: center;
  color: #667085;
  padding: 30px 10px;
  font-size: 12px;
}
/* =========================================================
   ATIA Integrator Workspace
   Scoped to .atia-workspace to avoid affecting other pages.
   ========================================================= */

.atia-workspace {
  max-width: 920px;
  margin: 0 auto;
}

.atia-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
}

.atia-eyebrow {
  margin-bottom: 6px;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.atia-hero h1 {
  margin-bottom: 4px;
  font-size: 34px;
  line-height: 1.1;
}

.atia-subtitle {
  margin: 0;
  color: #667085;
  font-size: 16px;
}

.atia-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  background: white;
  border: 1px solid #d9dee5;
  border-radius: 999px;
  padding: 8px 12px;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.atia-state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
}

.atia-scope-card,
.atia-chat-card,
.atia-start-card {
  background: white;
  border: 1px solid #dde2e7;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.atia-scope-card {
  padding: 18px 20px;
  margin-bottom: 20px;
}

.atia-scope-card p {
  margin: 7px 0 0;
  line-height: 1.55;
}

.atia-scope-title {
  font-weight: 700;
}

.atia-scope-note {
  color: #667085;
  font-size: 13px;
}

.atia-chat-card {
  overflow: hidden;
}

.atia-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.atia-chat-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.atia-conversation-meta {
  color: #667085;
  font-size: 12px;
}

.atia-chat-status {
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  padding: 5px 9px;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
}

.atia-conversation {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: #f8fafc;
}

.atia-message {
  max-width: 82%;
  border: 1px solid #e1e6eb;
  border-radius: 12px;
  padding: 13px 15px;
}

.atia-message-user {
  align-self: flex-end;
  background: #eef4ff;
  border-bottom-right-radius: 4px;
}

.atia-message-assistant {
  align-self: flex-start;
  background: white;
  border-bottom-left-radius: 4px;
}

.atia-message-accentra {
  align-self: flex-start;
  background: #fffbeb;
  border-bottom-left-radius: 4px;
}

.atia-message-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  font-size: 13px;
}

.atia-message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
  font-size: 14px;
}

.atia-scope-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}

.atia-scope-in {
  background: #ecfdf3;
  color: #166534;
}

.atia-scope-out {
  background: #fef2f2;
  color: #991b1b;
}

.atia-scope-review {
  background: #fffbeb;
  color: #92400e;
}

.atia-composer {
  padding: 18px 20px 20px;
  border-top: 1px solid #e5e7eb;
  background: white;
}

.atia-composer label {
  display: block;
  margin-bottom: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.atia-workspace .atia-composer textarea {
  min-height: 120px;
  margin: 0;
  resize: vertical;
  border-radius: 9px;
  background: #fff;
  line-height: 1.5;
}

.atia-workspace .atia-composer textarea:focus {
  outline: 2px solid #c7d7fe;
  border-color: #98a2b3;
}

.atia-composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.atia-composer-footer span {
  color: #667085;
  font-size: 11px;
}

.atia-workspace .atia-primary-button {
  background: #111827;
  color: white;
  padding: 10px 17px;
  font-weight: 700;
}

.atia-workspace .atia-primary-button:hover {
  background: #263244;
}

.atia-start-card {
  padding: 32px;
  text-align: center;
}

.atia-start-card h2 {
  margin-bottom: 8px;
}

.atia-start-card > p {
  max-width: 560px;
  margin: 0 auto 22px;
  color: #667085;
  line-height: 1.5;
}

.atia-start-icon {
  display: flex;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #111827;
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.atia-start-form {
  max-width: 700px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  text-align: left;
}

.atia-control-note {
  margin-top: 18px;
  padding: 13px 15px;
  border-left: 3px solid #98a2b3;
  background: #eef1f4;
  color: #475467;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .atia-hero,
  .atia-composer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .atia-state {
    align-self: flex-start;
  }

  .atia-message {
    max-width: 94%;
  }

  .atia-start-card {
    padding: 22px 16px;
  }

  .atia-workspace .atia-primary-button {
    width: 100%;
  }
}
/* ATIA controlled response formatting */

.atia-workspace .atia-message-body p {
  margin: 0 0 14px;
  line-height: 1.6;
}

.atia-workspace .atia-message-body p:last-child {
  margin-bottom: 0;
}

.atia-workspace .atia-message-body strong {
  font-weight: 700;
}

.atia-workspace .atia-message-body code {
  font-family:
    Consolas,
    "Courier New",
    monospace;
  font-size: 0.92em;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 2px 5px;
}

.atia-workspace .atia-message-body pre {
  overflow-x: auto;
  margin: 14px 0;
  padding: 14px 16px;
  background: #f3f4f6;
  border: 1px solid #e1e5ea;
  border-radius: 7px;
  line-height: 1.5;
}

.atia-workspace .atia-message-body pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  white-space: pre;
}

.atia-workspace .atia-message-body ul {
  margin: 10px 0 14px 22px;
  padding: 0;
}

.atia-workspace .atia-message-body li {
  margin: 5px 0;
  line-height: 1.55;
}
/* =========================================================
   Integrator Room AJAX Messaging
   ========================================================= */

.room-unread-badge {
  display: inline-block;
  min-width: 18px;
  margin-left: 4px;
  padding: 2px 5px;
  border-radius: 10px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.room-unread-badge[hidden] {
  display: none;
}

.room-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.room-heading h3 {
  margin-bottom: 5px;
}

.room-heading p {
  margin: 0;
}

.room-notification-button {
  white-space: nowrap;
}

.room-messages {
  margin-bottom: 22px;
}

.room-message {
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid #dde2e7;
  border-radius: 8px;
  background: #fff;
}

.room-message-own {
  background: #f8fafc;
}

.room-message-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 7px;
}

.room-message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.room-composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

@media (max-width: 640px) {
  .room-heading,
  .room-message-header,
  .room-composer-footer {
    flex-direction: column;
  }

  .room-notification-button,
  #room-send-button {
    width: 100%;
  }
}
