:root {
  --page-bg: #f4f7fb;
  --card-bg: #ffffff;
  --border: #dce3ec;

  --text: #18212f;
  --muted: #6b7788;

  --primary: #1f5eff;
  --primary-dark: #1748c9;

  --primary-soft: #edf3ff;
  --primary-border: #ccdafa;

  --header-start: #0f1b33;
  --header-middle: #172a4d;
  --header-end: #1d3e70;

  --success-bg: #e8f7ef;
  --success-text: #16784a;

  --error-bg: #fdecec;
  --error-text: #b42318;

  --shadow:
    0 8px 24px
    rgba(24, 33, 47, 0.08);

  --shadow-hover:
    0 10px 28px
    rgba(24, 33, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--page-bg);
  color: var(--text);

  line-height: 1.5;
}

button,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
}

.app-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 32px;

  padding:
    24px
    48px;

  background:
    linear-gradient(
      135deg,
      var(--header-start) 0%,
      var(--header-middle) 55%,
      var(--header-end) 100%
    );

  color: white;
}

.brand-lockup {
  display: flex;
  align-items: center;

  gap: 16px;
}

.product-logo {
  width: 48px;
  height: 48px;

  display: grid;
  place-items: center;

  border:
    1px solid
    rgba(255, 255, 255, 0.22);

  border-radius: 12px;

  background:
    rgba(255, 255, 255, 0.12);

  font-size: 16px;
  font-weight: 800;

  letter-spacing: 0.04em;
}

.product-name {
  margin-bottom: 1px;

  color: #9dbbff;

  font-size: 12px;
  font-weight: 800;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-copy h1 {
  margin: 0;

  font-size: 27px;
  font-weight: 700;

  letter-spacing: -0.02em;
}

.brand-copy p {
  margin:
    2px
    0
    0;

  color: #d5def0;

  font-size: 14px;
}

.header-meta {
  display: flex;

  gap: 10px;

  flex-wrap: wrap;

  justify-content: flex-end;
}

.environment-badge,
.preview-badge {
  display: inline-flex;
  align-items: center;

  border-radius: 999px;

  padding:
    6px
    11px;

  font-size: 12px;
  font-weight: 700;
}

.environment-badge {
  border:
    1px solid
    rgba(255, 255, 255, 0.18);

  background:
    rgba(255, 255, 255, 0.13);

  color: white;
}

.environment-badge.secondary {
  background:
    rgba(157, 187, 255, 0.14);

  color: #dce7ff;
}

.preview-badge {
  background: #eef2f7;
  color: #526173;
}

.page-shell {
  width:
    min(
      1180px,
      calc(100% - 48px)
    );

  margin:
    0
    auto;

  padding:
    28px
    0
    48px;
}

.panel {
  border:
    1px solid
    var(--border);

  border-radius: 14px;

  background: var(--card-bg);

  box-shadow: var(--shadow);
}

.context-panel {
  padding:
    20px
    22px;

  margin-bottom: 22px;
}

.context-heading {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 18px;
}

.context-heading strong {
  font-size: 16px;
}

.section-kicker {
  margin:
    0
    0
    4px;

  color: #53647a;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section-kicker.centered {
  text-align: center;
}

.dataset-control {
  max-width: 620px;
}

.dataset-control label {
  display: block;

  margin-bottom: 7px;

  color: var(--muted);

  font-size: 12px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dataset-control select {
  width: 100%;

  min-height: 46px;

  padding:
    0
    12px;

  border:
    1px solid
    #cbd4df;

  border-radius: 9px;

  background: white;
  color: var(--text);

  font-size: 14px;
}

.dataset-control select:focus {
  outline:
    3px solid
    rgba(31, 94, 255, 0.12);

  border-color: var(--primary);
}

.dataset-control select:disabled {
  opacity: 0.65;
}

.dataset-summary {
  display: grid;

  grid-template-columns:
    1fr
    1fr
    2fr;

  gap: 10px;

  margin-top: 16px;
}

.dataset-summary > div {
  min-width: 0;

  padding:
    11px
    12px;

  border:
    1px solid
    #e5eaf0;

  border-radius: 9px;

  background: #f7f9fc;
}

.dataset-summary span {
  display: block;

  margin-bottom: 3px;

  color: var(--muted);

  font-size: 10px;
  font-weight: 800;

  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dataset-summary strong {
  display: block;

  font-size: 13px;
  font-weight: 650;
}

.copilot-shell {
  min-height: 600px;

  display: flex;
  flex-direction: column;

  overflow: hidden;
}

.welcome-view {
  width:
    min(
      850px,
      calc(100% - 48px)
    );

  margin:
    auto;

  padding:
    54px
    0
    32px;

  text-align: center;
}

.copilot-mark {
  width: 52px;
  height: 52px;

  display: grid;
  place-items: center;

  margin:
    0
    auto
    16px;

  border-radius: 15px;

  background:
    linear-gradient(
      135deg,
      #1f5eff,
      #5d82ff
    );

  color: white;

  box-shadow:
    0 9px 22px
    rgba(31, 94, 255, 0.22);

  font-size: 25px;
}

.welcome-view h2 {
  margin:
    4px
    0
    10px;

  font-size:
    clamp(
      26px,
      4vw,
      34px
    );

  font-weight: 720;

  letter-spacing: -0.03em;
}

.welcome-description {
  max-width: 650px;

  margin:
    0
    auto;

  color: var(--muted);

  font-size: 15px;
}

.suggestion-section {
  margin-top: 36px;
}

.suggestion-heading {
  margin:
    0
    0
    12px;

  color: #465569;

  font-size: 13px;
  font-weight: 700;
}

.suggestion-grid {
  display: grid;

  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );

  gap: 10px;

  text-align: left;
}

.suggestion-card {
  min-height: 70px;

  display: flex;
  align-items: center;

  gap: 12px;

  padding:
    14px
    15px;

  border:
    1px solid
    #dfe5ed;

  border-radius: 11px;

  background: white;
  color: var(--text);

  text-align: left;

  font-size: 13px;
  font-weight: 620;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease;
}

.suggestion-card:hover {
  border-color: #b9caee;

  background: #fafcff;

  box-shadow:
    0 7px 18px
    rgba(24, 33, 47, 0.08);

  transform:
    translateY(-1px);
}

.suggestion-card:focus-visible {
  outline:
    3px solid
    rgba(31, 94, 255, 0.16);

  border-color:
    var(--primary);
}

.suggestion-card.wide {
  grid-column:
    1 / -1;
}

.suggestion-icon {
  width: 31px;
  height: 31px;

  flex:
    0 0
    31px;

  display: grid;
  place-items: center;

  border-radius: 8px;

  background: var(--primary-soft);
  color: #2456c5;

  font-size: 17px;
  font-weight: 800;
}

.conversation-view {
  flex: 1;

  padding:
    24px
    28px
    8px;
}

.conversation-toolbar {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 16px;

  padding-bottom: 18px;

  border-bottom:
    1px solid
    #e8ecf1;
}

.conversation-toolbar strong {
  font-size: 14px;
}

.text-button {
  padding:
    7px
    10px;

  border: 0;

  border-radius: 7px;

  background: transparent;
  color: #2456c5;

  font-size: 12px;
  font-weight: 700;
}

.text-button:hover:not(:disabled) {
  background: var(--primary-soft);
}

.text-button:disabled {
  opacity: 0.45;
}

.message-list {
  max-width: 900px;

  margin:
    0
    auto;

  padding:
    30px
    0;
}

.message {
  display: flex;

  gap: 13px;

  margin-bottom: 30px;
}

.message.user {
  justify-content: flex-end;
}

.message-avatar {
  width: 32px;
  height: 32px;

  flex:
    0
    0
    32px;

  display: grid;
  place-items: center;

  border-radius: 9px;

  background:
    linear-gradient(
      135deg,
      #1f5eff,
      #5d82ff
    );

  color: white;

  font-size: 14px;
  font-weight: 800;
}

.message-content {
  max-width: 760px;
}

.message-content.assistant-content {
  width: 100%;
}

.message-label {
  margin-bottom: 5px;

  color: var(--muted);

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message-body {
  padding:
    13px
    15px;

  border:
    1px solid
    #dfe5ed;

  border-radius:
    4px
    12px
    12px
    12px;

  background: #fafbfd;

  font-size: 14px;
}

.message.user .message-body {
  border-color:
    var(--primary-border);

  border-radius:
    12px
    4px
    12px
    12px;

  background:
    var(--primary-soft);
}

.message.user .message-label {
  text-align: right;
}

.assistant-response {
  width: 100%;
}

.analysis-loading {
  display: flex;

  align-items: center;

  gap: 14px;

  padding:
    16px;

  border:
    1px solid
    #dfe5ed;

  border-radius: 11px;

  background: #fafbfd;
}

.analysis-loading strong {
  display: block;

  margin-bottom: 3px;

  font-size: 14px;
}

.analysis-loading p {
  margin: 0;

  color: var(--muted);

  font-size: 12px;
}

.analysis-spinner {
  width: 28px;
  height: 28px;

  flex:
    0
    0
    28px;

  border:
    3px solid
    #dce6f7;

  border-top-color:
    var(--primary);

  border-radius: 50%;

  animation:
    analysis-spin
    0.85s
    linear
    infinite;
}

@keyframes analysis-spin {
  to {
    transform:
      rotate(360deg);
  }
}

.analysis-error {
  padding:
    15px
    16px;

  border:
    1px solid
    #f1b9b5;

  border-radius: 10px;

  background:
    var(--error-bg);

  color:
    var(--error-text);
}

.analysis-error strong {
  display: block;

  margin-bottom: 3px;
}

.analysis-error p {
  margin: 0;

  font-size: 13px;
}

.analysis-result {
  display: flex;
  flex-direction: column;

  gap: 18px;
}

.analysis-summary {
  padding:
    18px
    19px;

  border:
    1px solid
    #d7e2f7;

  border-left:
    4px solid
    var(--primary);

  border-radius: 10px;

  background: #f8faff;
}

.analysis-summary-label {
  margin-bottom: 5px;

  color: #2456c5;

  font-size: 10px;
  font-weight: 800;

  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analysis-summary p {
  margin: 0;

  font-size: 14px;
  line-height: 1.65;
}

.analysis-section-title {
  margin:
    4px
    0
    -7px;

  color: #465569;

  font-size: 12px;
  font-weight: 800;

  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bottleneck-grid {
  display: grid;

  gap: 12px;
}

.analysis-card {
  padding:
    16px
    17px;

  border:
    1px solid
    #dfe5ed;

  border-radius: 11px;

  background: white;
}

.bottleneck-card.primary {
  border-color:
    #b9caee;

  box-shadow:
    inset
    4px
    0
    0
    var(--primary);
}

.bottleneck-header {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 14px;

  margin-bottom: 8px;
}

.bottleneck-header h4 {
  margin: 0;

  font-size: 16px;
  font-weight: 750;
}

.rank-badge {
  flex-shrink: 0;

  padding:
    4px
    8px;

  border-radius: 999px;

  background:
    var(--primary-soft);

  color: #2456c5;

  font-size: 10px;
  font-weight: 800;

  text-transform: uppercase;
}

.finding-text {
  margin:
    0
    0
    12px;

  color: #3f4c5d;

  font-size: 13px;
}

.evidence-block {
  margin-top: 10px;

  padding-top: 10px;

  border-top:
    1px solid
    #edf0f4;
}

.evidence-block strong {
  display: block;

  margin-bottom: 3px;

  color: #53647a;

  font-size: 10px;
  font-weight: 800;

  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.evidence-block p {
  margin: 0;

  color: #455161;

  font-size: 12px;
  line-height: 1.55;
}

.analysis-list,
.recommendation-list {
  display: flex;
  flex-direction: column;

  gap: 8px;
}

.analysis-list-item,
.recommendation-item {
  display: flex;

  align-items: flex-start;

  gap: 11px;

  padding:
    12px
    13px;

  border:
    1px solid
    #e3e8ee;

  border-radius: 9px;

  background: #fafbfd;
}

.list-marker {
  width: 22px;
  height: 22px;

  flex:
    0
    0
    22px;

  display: grid;
  place-items: center;

  margin-top: 1px;

  border-radius: 7px;

  background:
    var(--primary-soft);

  color:
    var(--primary);

  font-size: 18px;
  font-weight: 800;
}

.analysis-list-item strong,
.recommendation-item strong {
  display: block;

  color: var(--text);

  font-size: 13px;
}

.analysis-list-item p,
.recommendation-item p {
  margin:
    4px
    0
    0;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.55;
}

.recommendation-number {
  width: 25px;
  height: 25px;

  flex:
    0
    0
    25px;

  display: grid;
  place-items: center;

  border-radius: 8px;

  background:
    var(--primary);

  color: white;

  font-size: 11px;
  font-weight: 800;
}

.analysis-details {
  margin-top: 2px;

  padding-top: 4px;

  border-top:
    1px solid
    #e8ecf1;
}

.analysis-details summary {
  padding:
    8px
    0;

  cursor: pointer;

  color: #53647a;

  font-size: 11px;
  font-weight: 700;
}

.analysis-details-grid {
  display: grid;

  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );

  gap: 8px;

  padding-top: 7px;
}

.analysis-detail-item {
  min-width: 0;

  padding:
    9px
    10px;

  border:
    1px solid
    #e5eaf0;

  border-radius: 8px;

  background:
    #f7f9fc;
}

.analysis-detail-item span {
  display: block;

  margin-bottom: 2px;

  color: var(--muted);

  font-size: 9px;
  font-weight: 800;

  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.analysis-detail-item strong {
  display: block;

  overflow-wrap: anywhere;

  font-size: 11px;
  font-weight: 650;
}

.composer {
  width:
    min(
      880px,
      calc(100% - 48px)
    );

  display: flex;
  align-items: flex-end;

  gap: 10px;

  margin:
    0
    auto
    6px;

  padding:
    9px
    9px
    9px
    15px;

  border:
    1px solid
    #ccd5e1;

  border-radius: 14px;

  background: white;

  box-shadow:
    0 5px 18px
    rgba(24, 33, 47, 0.07);
}

.composer:focus-within {
  border-color: #9bb4eb;

  box-shadow:
    0 0 0 3px
    rgba(31, 94, 255, 0.08);
}

.composer textarea {
  width: 100%;

  min-height: 38px;
  max-height: 150px;

  resize: none;

  padding:
    8px
    4px;

  border: 0;
  outline: 0;

  background: transparent;
  color: var(--text);

  font-size: 14px;
  line-height: 1.45;
}

.composer textarea::placeholder {
  color: #8a96a6;
}

.composer textarea:disabled {
  opacity: 0.65;
}

.send-button {
  width: 42px;
  height: 42px;

  flex:
    0
    0
    42px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 10px;

  background: var(--primary);
  color: white;

  font-size: 18px;
  font-weight: 800;

  transition:
    background 0.15s ease,
    opacity 0.15s ease;
}

.send-button:hover:not(:disabled) {
  background:
    var(--primary-dark);
}

.send-button:disabled {
  opacity: 0.42;
}

.composer-note {
  width:
    min(
      880px,
      calc(100% - 48px)
    );

  display: flex;

  justify-content: space-between;

  gap: 20px;

  margin:
    0
    auto
    18px;

  color: #7a8696;

  font-size: 10px;
}

.app-footer {
  padding:
    18px
    24px
    30px;

  color: var(--muted);

  text-align: center;

  font-size: 11px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;

  width: 1px;
  height: 1px;

  padding: 0;
  margin: -1px;

  overflow: hidden;

  clip:
    rect(
      0,
      0,
      0,
      0
    );

  white-space: nowrap;

  border: 0;
}

@media (max-width: 800px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;

    padding:
      22px
      24px;
  }

  .header-meta {
    justify-content: flex-start;
  }

  .page-shell {
    width:
      calc(100% - 28px);

    padding-top: 16px;
  }

  .dataset-summary {
    grid-template-columns: 1fr;
  }

  .welcome-view {
    width:
      calc(100% - 30px);

    padding-top: 38px;
  }

  .suggestion-grid {
    grid-template-columns: 1fr;
  }

  .suggestion-card.wide {
    grid-column: auto;
  }

  .conversation-view {
    padding:
      20px
      16px
      6px;
  }

  .composer,
  .composer-note {
    width:
      calc(100% - 28px);
  }

  .composer-note {
    flex-direction: column;

    gap: 2px;
  }

  .analysis-details-grid {
    grid-template-columns: 1fr;
  }
}