﻿:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-muted: #f0f4f7;
  --ink: #18222d;
  --muted: #637386;
  --line: #d8e0e8;
  --blue: #1f6fb2;
  --blue-strong: #155787;
  --green: #24785f;
  --amber: #a35d00;
  --red: #a33636;
  --shadow: 0 12px 28px rgba(24, 34, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Malgun Gothic", Arial, sans-serif;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 24px 0 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1.16;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 17px;
  letter-spacing: 0;
}

.lede {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
}

.guardrail-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(112px, 1fr));
  gap: 8px;
  min-width: 300px;
}

.guardrail-panel span,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.green {
  border-color: rgba(36, 120, 95, 0.3);
  background: #e9f6f0;
  color: var(--green);
}

.status-pill.amber {
  border-color: rgba(163, 93, 0, 0.3);
  background: #fff4df;
  color: var(--amber);
}

.status-pill.red {
  border-color: rgba(163, 54, 54, 0.28);
  background: #fff0f0;
  color: var(--red);
}

.status-pill.neutral {
  background: var(--surface-muted);
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tab-button.active {
  border-color: var(--line);
  border-bottom-color: var(--surface);
  background: var(--surface);
  color: var(--blue-strong);
}

.command-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.flow-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.flow-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--blue-strong);
  font-size: 12px;
}

.flow-step.active {
  border-color: rgba(31, 111, 178, 0.45);
  background: #eaf3fb;
  color: var(--blue-strong);
}

.live-bridge {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.bridge-item {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.bridge-item span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bridge-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.record-preview {
  display: grid;
  gap: 3px;
  min-width: 172px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.record-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.record-preview strong {
  color: var(--blue-strong);
  font-size: 19px;
}

.work-grid,
.support-grid,
.automation-layout,
.option-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.intake-form,
.side-panel,
.automation-card,
.search-panel,
.answer-panel,
.selection-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

fieldset {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

legend,
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.segmented-control {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  width: min(100%, 320px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segment {
  min-height: 40px;
  border: 0;
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 700;
}

.segment + .segment {
  border-left: 1px solid var(--line);
}

.segment.active {
  background: var(--blue);
  color: #ffffff;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(31, 111, 178, 0.24);
  outline-offset: 2px;
}

.attachment-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #aab7c4;
  border-radius: 8px;
  background: #f9fbfc;
}

.attachment-box p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 800;
}

.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--blue-strong);
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.side-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.workflow-asset {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.notice-box,
.case-summary,
.reference-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 14px;
}

.notice-box p,
.case-summary p,
.automation-card p,
.reference-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.handoff-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.definition-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.definition-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--ink);
  font-weight: 800;
}

dd {
  margin: 0;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.timeline li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.search-results,
.answer-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.result-item,
.answer-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.result-item {
  display: grid;
  gap: 8px;
}

.result-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--blue-strong);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.row-link {
  min-width: 88px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.result-meta span {
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-title-row select {
  max-width: 160px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf3f8;
  color: #2b3a49;
  font-weight: 800;
}

tbody tr:hover {
  background: #f5f9fc;
}

tbody tr.selected-row {
  background: #eaf3fb;
}

.option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.option-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.option-card.selected {
  border-color: rgba(31, 111, 178, 0.55);
  box-shadow: inset 0 0 0 2px rgba(31, 111, 178, 0.12);
}

.option-head {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.option-head span {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 900;
}

.option-card ul {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--muted);
}

.selection-panel {
  background: #f9fbfc;
}

.empty-state {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 960px) {
  .topbar,
  .command-strip,
  .work-grid,
  .support-grid,
  .automation-layout,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .guardrail-panel {
    min-width: 0;
  }

  .field-grid,
  .filter-bar,
  .live-bridge {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-steps {
    grid-template-columns: repeat(5, minmax(74px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px;
  }

  h1 {
    font-size: 28px;
  }

  .view {
    padding: 16px;
  }

  .section-head,
  .attachment-box {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .section-head {
    display: grid;
  }

  .field-grid,
  .filter-bar,
  .guardrail-panel,
  .live-bridge,
  .handoff-actions {
    grid-template-columns: 1fr;
  }

  .flow-steps {
    grid-template-columns: repeat(5, 86px);
  }

  .definition-list div {
    grid-template-columns: 1fr;
  }
}

