/* Demo shell: neutral, presentation-friendly layout */

:root {
  --bg: #eef0f4;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #d8dde6;
  --text: #16181d;
  --muted: #5a6270;
  --accent: #1e4fa3;
  --accent-hover: #163d82;
  --danger: #9a1c1c;
  --danger-hover: #7f1515;
  --success: #1b5e20;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.04);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: "Cascadia Code", "Consolas", "SFMono-Regular", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.app-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.app-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.app-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 42rem;
}

.app-meta {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
}

.banner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.banner--warn {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fff8e6;
  border: 1px solid #e3c77a;
  border-radius: var(--radius);
  color: #5c4a12;
  font-size: 0.9rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel__head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.panel__lede {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.panel__body {
  padding: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

textarea {
  min-height: 5rem;
  resize: vertical;
  font-family: var(--font);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(30, 79, 163, 0.25);
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn--danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid #e5bcbc;
}

.btn--danger:hover:not(:disabled) {
  background: #fff5f5;
  border-color: var(--danger);
  color: var(--danger-hover);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.toolbar__grow {
  flex: 1;
  min-width: 12rem;
}

.dropzone {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.9rem;
}

.dropzone input[type="file"] {
  margin-top: 0.5rem;
  max-width: 100%;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--ok {
  background: #e8f5e9;
  color: var(--success);
}

.badge--wait {
  background: #e3f2fd;
  color: #1565c0;
}

.badge--err {
  background: #ffebee;
  color: var(--danger);
}

.chat-log {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
}

.chat-msg {
  margin-bottom: 1rem;
}

.chat-msg:last-child {
  margin-bottom: 0;
}

.chat-msg__role {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.chat-msg--user .chat-msg__body {
  white-space: pre-wrap;
}

.chat-msg--assistant .chat-msg__body {
  white-space: pre-wrap;
}

.sources {
  margin-top: 0.5rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
}

.sources li {
  margin-bottom: 0.35rem;
}

.mcp-log {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  background: #0f1419;
  color: #e6edf3;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  min-height: 200px;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.mcp-log .line {
  margin-bottom: 0.35rem;
}

.mcp-log .ts {
  color: #8b949e;
}

.mcp-playbook {
  background: linear-gradient(135deg, #f0f4ff 0%, #f8f9fb 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.mcp-playbook__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.mcp-playbook__steps {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
}

.mcp-playbook__steps li {
  margin-bottom: 0.35rem;
}

.mcp-field-wrap {
  margin-top: 0.75rem;
}

.mcp-field-wrap label {
  display: block;
  margin-top: 0.5rem;
}

.mcp-field-wrap label:first-child {
  margin-top: 0;
}

.mcp-field-wrap__inline {
  display: inline-block !important;
  margin-top: 0.65rem !important;
  margin-right: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.mcp-input-num {
  max-width: 100%;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font);
}

@media (min-width: 480px) {
  .mcp-field-wrap .mcp-input-num {
    width: auto;
    min-width: 8rem;
  }
}

.mcp-highlight {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0;
  min-height: 120px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.mcp-highlight code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  padding: 0;
}

.footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
