:root {
  --bg: #eef3ff;
  --surface: #ffffff;
  --surface-2: #f7f9ff;
  --ink: #0d1835;
  --muted: #65728c;
  --line: #dce5f7;
  --navy: #08113f;
  --navy-2: #101f67;
  --purple: #6d4cff;
  --blue: #2d7cff;
  --cyan: #2bd4ff;
  --green: #12bd7b;
  --orange: #ff9d2e;
  --danger: #ef476f;
  --shadow: 0 20px 50px rgba(16, 39, 97, 0.12);
  --soft-shadow: 0 10px 24px rgba(16, 39, 97, 0.08);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(109, 76, 255, 0.12), transparent 24%),
    radial-gradient(circle at 92% 0%, rgba(43, 212, 255, 0.16), transparent 22%),
    linear-gradient(180deg, #f5f8ff, var(--bg));
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.72; }
h1, h2, h3, p { margin-top: 0; }

.work-os {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.os-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  align-content: start;
  gap: 20px;
  height: 100vh;
  padding: 22px;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 0%, rgba(109, 76, 255, 0.5), transparent 32%),
    linear-gradient(180deg, var(--navy), #050a2d);
  color: white;
}

.brand-block {
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: 100%;
  max-width: 216px;
  height: auto;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav button {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #dce5ff;
  text-align: left;
}

.side-nav button span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.side-nav b {
  font-size: 13px;
}

.side-nav em {
  color: #91a4e8;
  font-size: 10px;
  font-style: normal;
}

.side-nav button.active,
.side-nav button:hover {
  background: white;
  color: var(--navy);
}

.sidebar-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-card span {
  color: #b8c6ff;
  font-size: 12px;
}

.sidebar-card b {
  font-size: 14px;
}

.sidebar-card button,
.top-actions button,
.section-title button,
.command-actions button,
.mini-form button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  font-weight: 900;
}

.sidebar-card button {
  min-height: 38px;
}

.workspace-shell {
  min-width: 0;
  padding: 22px;
}

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

.topbar h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -0.055em;
}

.topbar p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions button {
  min-height: 40px;
  padding: 0 14px;
  background: white;
  color: var(--navy);
  border: 1px solid var(--line);
}

.user-chip {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 210px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--soft-shadow);
}

.user-chip > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #eaf1ff;
  color: #174488;
  font-weight: 950;
}

.user-chip b,
.user-chip em {
  display: block;
}

.user-chip em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.main-work,
.context-rail {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.command-center,
.panel-section,
.rail-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.command-center {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 88% 0%, rgba(43, 212, 255, 0.16), transparent 28%),
    linear-gradient(135deg, #ffffff, #f6f8ff);
}

.command-copy {
  max-width: 800px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #087a5c;
  font-size: 12px;
  font-weight: 900;
}

.status-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(18, 189, 123, 0.12);
}

.command-copy h2 {
  margin-bottom: 8px;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

.command-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.command-form {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.command-form textarea,
.command-actions select,
.mini-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  outline: 0;
}

.command-form textarea {
  min-height: 120px;
  padding: 16px;
  resize: vertical;
  font-size: 16px;
  line-height: 1.5;
}

.command-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
}

.command-actions select {
  min-height: 50px;
  padding: 0 14px;
}

.command-actions button {
  min-height: 50px;
  box-shadow: 0 14px 26px rgba(45, 124, 255, 0.24);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.pipeline-step {
  position: relative;
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.pipeline-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 44px;
  right: -16px;
  z-index: 1;
  color: #8fa1c4;
  font-weight: 950;
}

.pipeline-step small,
.pipeline-step b,
.pipeline-step em {
  display: block;
}

.pipeline-step small {
  color: var(--green);
  font-weight: 950;
}

.pipeline-step span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 8px 0;
  border-radius: 14px;
  background: #edf4ff;
}

.pipeline-step b {
  font-size: 13px;
}

.pipeline-step em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.pipeline-step.ready {
  border-color: rgba(109, 76, 255, 0.5);
  background: #f5f2ff;
}

.panel-section,
.rail-panel {
  border-radius: 24px;
  padding: 20px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title h2,
.rail-title h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.section-title p,
.rail-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.section-title button {
  align-self: start;
  min-height: 38px;
  padding: 0 14px;
}

.recommended-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tool-card,
.template-card,
.library-grid button {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(28, 64, 130, 0.06);
}

.tool-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  min-height: 112px;
  padding: 14px;
  text-align: left;
}

.tool-card span,
.library-grid span,
.rail-title > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 15px;
  background: #eaf2ff;
}

.tool-card b,
.tool-card em {
  display: block;
}

.tool-card b {
  margin-bottom: 5px;
  font-size: 14px;
}

.tool-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.tool-card.active,
.library-grid button.active {
  border-color: var(--purple);
  background: #f3f0ff;
}

.tool-library {
  margin-top: 14px;
}

.tool-library summary {
  color: var(--blue);
  font-weight: 900;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.library-grid button {
  position: relative;
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 92px;
  padding: 14px 8px 10px;
}

.library-grid small {
  position: absolute;
  top: 8px;
  left: 9px;
  color: var(--green);
  font-size: 10px;
  font-weight: 950;
}

.library-grid b {
  font-size: 12px;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.template-card {
  display: grid;
  gap: 8px;
  min-height: 160px;
  padding: 14px;
  text-align: left;
}

.template-card span {
  font-size: 22px;
}

.template-card b {
  font-size: 14px;
}

.template-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.template-card em {
  align-self: end;
  color: var(--blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.result-types {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.result-types span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 14px;
  background: #eafff5;
  color: #075f48;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.artifact-list,
.file-list,
.activity-list {
  display: grid;
  gap: 10px;
}

.artifact-card,
.file-row,
.profile-row,
.agent-card,
.activity-list p,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 13px;
}

.artifact-card b,
.artifact-card span,
.file-row b,
.file-row span {
  display: block;
}

.artifact-card span,
.artifact-card p,
.file-row span {
  color: var(--muted);
  font-size: 12px;
}

.artifact-card summary {
  color: var(--blue);
  font-weight: 900;
}

.artifact-card h3 {
  margin: 12px 0 4px;
  font-size: 13px;
}

.context-rail {
  position: sticky;
  top: 22px;
}

.rail-title {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.ai-profile {
  background:
    radial-gradient(circle at 90% 0%, rgba(43, 212, 255, 0.16), transparent 30%),
    white;
}

.profile-row {
  margin-bottom: 8px;
}

.profile-row b,
.profile-row span {
  display: block;
}

.profile-row b {
  margin-bottom: 4px;
  font-size: 12px;
}

.profile-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.agent-card p {
  margin: 8px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.agent-card span {
  color: #0c7e61;
  font-size: 12px;
  font-weight: 900;
}

.mini-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mini-form input {
  min-height: 40px;
  padding: 0 12px;
}

.mini-form button {
  min-height: 40px;
}

.activity-list p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.activity-list b {
  font-size: 12px;
}

.activity-list span {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.mobile-dock {
  display: none;
}

.fatal {
  min-height: 100vh;
  padding: 40px;
  color: white;
  background: var(--navy);
}
