/* OACRM AI Studio — Claude-style chat production UI */
:root {
  --bg: #f4f4f0;
  --surface: #ffffff;
  --surface2: #fafaf8;
  --border: #e5e5e0;
  --text: #1a1a1a;
  --muted: #6b6b66;
  --primary: #1a6bcc;
  --primary-dark: #1456a6;
  --sidebar: #171717;
  --sidebar2: #262626;
  --user-bg: #1a6bcc;
  --bot-bg: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 260px; flex-shrink: 0; background: var(--sidebar);
  color: #e5e5e5; display: flex; flex-direction: column;
}
.sb-head { padding: 16px 14px 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sb-logo .ico {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg,#3b82f6,#1d4ed8);
  display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #fff;
}
.sb-logo b { display: block; font-size: 12px; color: #fff; letter-spacing: .04em; }
.sb-logo small { font-size: 10px; opacity: .5; }
.btn-new {
  width: 100%; padding: 10px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
  background: rgba(255,255,255,.06); color: #fff; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
}
.btn-new:hover { background: rgba(255,255,255,.1); }
.sb-section { padding: 14px 14px 6px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .4; }
.sb-nav { padding: 0 8px; overflow-y: auto; flex: 1; }
.sb-empty { padding: 12px; font-size: 12px; opacity: .4; }
.nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px;
  border: none; background: none; color: rgba(255,255,255,.7); font-size: 13px;
  border-radius: 8px; cursor: pointer; text-align: left; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #3b82f6; flex-shrink: 0; }
.sb-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.ws-card { background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px 12px; font-size: 11px; }
.ws-card b { display: block; color: #fff; margin-bottom: 8px; }
.ws-row { display: flex; justify-content: space-between; margin-bottom: 4px; opacity: .85; }
.ws-row i.on { color: #4ade80; font-style: normal; }
.ws-row i.off { color: #f87171; font-style: normal; }

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header {
  height: 52px; padding: 0 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb b { color: var(--text); }
.header-right { display: flex; align-items: center; gap: 10px; }
.sel {
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  background: var(--surface2); font-size: 12px; font-family: inherit;
}
.gpu-pill {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; font-size: 12px;
}
.gpu-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.gpu-pill .dot.busy { background: #f59e0b; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.workspace { flex: 1; display: flex; min-height: 0; }
.chat-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.thread {
  flex: 1; overflow-y: auto; padding: 24px 0 12px;
  max-width: 820px; width: 100%; margin: 0 auto;
}
.welcome { text-align: center; padding: 48px 24px; }
.welcome h1 { font-size: 28px; font-weight: 700; margin: 0 0 10px; letter-spacing: -.02em; }
.welcome p { color: var(--muted); max-width: 480px; margin: 0 auto 28px; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 10px 14px; font-size: 12px; cursor: pointer; font-family: inherit; color: var(--text);
}
.chip:hover { border-color: var(--primary); background: #eff6ff; }

.msg { display: flex; padding: 6px 24px; }
.msg.user { justify-content: flex-end; }
.msg.bot { justify-content: flex-start; }
.bubble {
  max-width: min(640px, 92%); padding: 12px 16px; border-radius: 16px;
  line-height: 1.55; font-size: 14px; box-shadow: var(--shadow);
}
.msg.user .bubble { background: var(--user-bg); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot .bubble { background: var(--bot-bg); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-media { display: block; max-width: 100%; border-radius: 10px; margin-top: 10px; }
.msg-audio { width: 100%; margin-top: 8px; }
.msg-job { margin-top: 8px; font-size: 12px; opacity: .7; }
.msg-err { margin-top: 8px; font-size: 12px; color: #dc2626; }

.composer {
  max-width: 820px; width: 100%; margin: 0 auto 20px; padding: 0 20px;
}
.composer-modes { display: flex; gap: 4px; margin-bottom: 8px; }
.cm {
  border: none; background: transparent; padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit;
}
.cm.on { background: #e8eef8; color: var(--primary); }
.composer-row {
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 10px 12px; box-shadow: var(--shadow);
}
.composer-row textarea {
  flex: 1; border: none; resize: none; outline: none; font-family: inherit;
  font-size: 14px; line-height: 1.45; max-height: 160px; background: transparent;
  padding: 4px 0;
}
.send {
  width: 36px; height: 36px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}
.send:disabled { opacity: .4; cursor: default; }
.send:hover:not(:disabled) { background: var(--primary-dark); }

.rail {
  width: 280px; flex-shrink: 0; background: var(--surface);
  border-left: 1px solid var(--border); overflow-y: auto; padding: 16px;
}
.rail-head { font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.rail-section { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.rail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.thumb { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.rail-list { display: flex; flex-direction: column; gap: 6px; }
.rail-link { font-size: 12px; color: var(--primary); text-decoration: none; }
.rail-audio { width: 100%; height: 32px; }
.muted { color: var(--muted); font-size: 12px; margin: 0; }

.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1a1a1a; color: #fff; padding: 12px 16px; border-radius: 10px;
  font-size: 13px; box-shadow: var(--shadow); max-width: 320px;
}

@media (max-width: 960px) {
  .rail { display: none; }
  .sidebar { width: 72px; }
  .sb-logo div, .sb-section, .sb-foot, .nav-item span:not(.nav-dot), .btn-new span:last-child { display: none; }
  .btn-new { padding: 10px; }
}
