:root {
  --bg: #0e1118;
  --panel: #151a23;
  --panel-2: #10151d;
  --border: #262d39;
  --text: #e5edf7;
  --muted: #93a3b8;
  --accent: #00c8ff;
  --accent-2: #1d9bf0;
  --success: #14d17b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at top left, rgba(0, 200, 255, 0.12), transparent 30%), linear-gradient(180deg, #111722 0%, #0b0f16 100%); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; }

.app-shell { display: grid; grid-template-columns: 340px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #111722 0%, #0d121a 100%); border-right: 1px solid var(--border); padding: 24px 18px; }
.brand { display: flex; gap: 14px; align-items: center; padding: 10px 6px 22px; }
.brand-mark { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--accent), #5ce1ff); color: #021019; display: grid; place-items: center; font-weight: 800; letter-spacing: .08em; }
.brand-title { font-size: 16px; font-weight: 700; }
.brand-subtitle { color: var(--muted); font-size: 12px; margin-top: 2px; }
.sidebar-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.sidebar-card.muted p { color: var(--muted); margin: 0; line-height: 1.5; font-size: 13px; }
.sidebar-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 12px; }
.sidebar-step { padding: 10px 12px; border-radius: 12px; margin-bottom: 8px; color: var(--muted); background: rgba(255,255,255,0.02); }
.sidebar-step.active { color: var(--text); border: 1px solid rgba(0, 200, 255, 0.25); background: rgba(0, 200, 255, 0.08); }

.workspace { padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 0; font-size: 28px; line-height: 1.1; }
.topbar p { margin: 10px 0 0; color: var(--muted); max-width: 760px; }
.status-pill { align-self: center; padding: 10px 14px; border-radius: 999px; background: rgba(20, 209, 123, 0.12); color: #9ff0c8; border: 1px solid rgba(20, 209, 123, 0.25); font-size: 13px; }
.providers-panel { margin-bottom: 14px; }
.providers-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.providers-meta { color: var(--muted); font-size: 11px; margin-bottom: 12px; line-height: 1.35; }
.providers-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.provider-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: rgba(255,255,255,0.03); min-width: 0; }
.provider-head { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.provider-name { font-weight: 700; }
.provider-model { color: var(--muted); font-size: 12px; margin-top: 4px; word-break: break-word; }
.provider-badge { padding: 6px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.badge-ok { background: rgba(20, 209, 123, 0.12); color: #9ff0c8; border: 1px solid rgba(20, 209, 123, 0.25); }
.badge-missing { background: rgba(255, 193, 7, 0.1); color: #f9d66e; border: 1px solid rgba(255, 193, 7, 0.2); }
.badge-off { background: rgba(255, 255, 255, 0.04); color: var(--muted); border: 1px solid var(--border); }
.provider-error { color: #ffb4b4; font-size: 11px; line-height: 1.4; margin-top: 10px; min-height: 18px; word-break: break-word; }
.provider-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.icon-button { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border); background: rgba(255,255,255,0.06); color: var(--text); cursor: pointer; font-size: 17px; line-height: 1; }
.icon-button:hover { border-color: rgba(0, 200, 255, 0.55); color: var(--accent); }

.grid { display: grid; grid-template-columns: 360px 1fr; gap: 18px; margin-bottom: 18px; }
.panel { background: linear-gradient(180deg, rgba(21,26,35,0.94), rgba(16,21,29,0.94)); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.panel-upload, .panel-main, .response-panel { padding: 18px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.panel-header h2 { margin: 0; font-size: 17px; }
.panel-chip { padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,0.04); color: var(--muted); font-size: 12px; border: 1px solid var(--border); }
.field-help { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 5px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.response-output-header { margin-top: 18px; }

.drop-zone { border: 1px dashed rgba(0, 200, 255, 0.35); background: rgba(0, 200, 255, 0.05); border-radius: 18px; padding: 28px 20px; text-align: center; display: grid; gap: 8px; place-items: center; cursor: pointer; }
.drop-zone.dragover { background: rgba(0, 200, 255, 0.12); border-color: rgba(0, 200, 255, 0.75); }
.drop-icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(0,200,255,.2), rgba(29,155,240,.2)); color: var(--accent); font-size: 24px; }
.drop-title { font-size: 18px; font-weight: 700; }
.drop-text { color: var(--muted); font-size: 13px; }

.file-row { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-top: 18px; }
.field-label { color: var(--muted); font-size: 12px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; }
.file-name { word-break: break-word; color: var(--text); font-size: 14px; }

textarea { width: 100%; border: 1px solid var(--border); background: rgba(9, 13, 20, 0.85); color: var(--text); border-radius: 14px; padding: 14px; resize: vertical; min-height: 320px; outline: none; line-height: 1.55; }
textarea:focus { border-color: rgba(0, 200, 255, 0.7); box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.12); }
.context { min-height: 118px; margin-bottom: 14px; }
.answer { min-height: 240px; margin-top: 14px; }

.actions { display: flex; gap: 10px; align-items: center; }
.button { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; cursor: pointer; transition: transform .15s ease, opacity .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; }
.button.secondary { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--border); }
.button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }

.notice { margin-top: 14px; color: var(--muted); font-size: 13px; min-height: 20px; }

.developer-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 16px 4px 6px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

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

.developer-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .app-shell, .grid { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (max-width: 720px) {
  .workspace { padding: 18px; }
  .topbar { flex-direction: column; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .file-row, .actions { flex-direction: column; align-items: stretch; }
  .developer-footer { flex-direction: column; align-items: flex-start; }
  textarea { min-height: 240px; }
}
