:root {
  color-scheme: dark;
  --bg: #090b12;
  --surface: rgba(255, 255, 255, 0.075);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --text: #f8fafc;
  --muted: #9aa4b2;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #9d7cff;
  --accent-2: #33d6a6;
  --warm: #ffb86b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(157, 124, 255, 0.3), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(51, 214, 166, 0.18), transparent 30rem),
    var(--bg);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: 18rem 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem;
  border-right: 1px solid var(--line);
  background: rgba(7, 10, 18, 0.78);
  backdrop-filter: blur(24px);
}

.brand { display: flex; gap: 0.9rem; align-items: center; margin-bottom: 2rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #080a10;
  font-weight: 900;
}

h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.1rem; }
h2 { max-width: 56rem; font-size: clamp(1.8rem, 4vw, 3.7rem); line-height: 0.98; letter-spacing: -0.055em; }
h3 { margin-bottom: 0; font-size: 1.4rem; }
h4 { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }

.eyebrow { margin-bottom: 0.35rem; color: var(--accent-2); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }

nav { display: grid; gap: 0.4rem; }
nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.8rem 0.9rem;
  border-radius: 0.9rem;
}
nav a:hover,
nav a:first-child { color: var(--text); background: var(--surface); }

.sidebar-card {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}
.sidebar-card p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.8rem; }
.status-dot { width: 0.7rem; height: 0.7rem; margin-top: 0.25rem; border-radius: 999px; background: var(--accent-2); box-shadow: 0 0 1.2rem var(--accent-2); }

main { padding: 2rem; overflow: hidden; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: 1.5rem;
  align-items: end;
  padding: 1.25rem 0 1.5rem;
}
.hero-copy { max-width: 42rem; color: var(--muted); font-size: 1.05rem; }
.hero-card, .panel {
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: linear-gradient(180deg, var(--surface-strong), rgba(255, 255, 255, 0.055));
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.28);
}
.hero-card { padding: 1.2rem; }
.hero-card span { color: var(--muted); font-size: 0.8rem; }
.hero-card strong { display: block; margin: 0.35rem 0; font-size: 1.2rem; }
.hero-card p { margin-bottom: 0; color: var(--muted); }

.grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.two-column { grid-template-columns: 1.15fr 0.85fr; }
.three-column { grid-template-columns: repeat(3, 1fr); }
.panel { padding: 1.25rem; }
.panel-header { margin-bottom: 1rem; }
.panel-header.split { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }

button {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: #080a10;
  font-weight: 800;
  cursor: pointer;
}
button:hover { transform: translateY(-1px); }

.drop-target {
  display: grid;
  place-items: center;
  min-height: 12rem;
  padding: 1.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 1.2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
}
.upload-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 1rem;
  background: rgba(157, 124, 255, 0.2);
  color: var(--accent);
  font-size: 1.7rem;
}
.drop-target p { max-width: 30rem; color: var(--muted); }
.drop-target.is-dragging {
  border-color: var(--accent-2);
  background: rgba(51, 214, 166, 0.1);
  box-shadow: inset 0 0 0 1px rgba(51, 214, 166, 0.2);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.uploaded-files-list,
.upload-status-panel,
.upload-inbox-card {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(157, 124, 255, 0.08);
  color: #eee9ff;
}
.upload-status-panel {
  background: rgba(51, 214, 166, 0.08);
}
.uploaded-files-list span,
.uploaded-files-list p,
.upload-status-panel span,
.upload-status-panel p,
.upload-inbox-card span,
.upload-inbox-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.uploaded-files-list ul { display: grid; gap: 0.5rem; margin: 0.4rem 0 0; padding: 0; list-style: none; }
.uploaded-files-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem; border-radius: 0.75rem; background: rgba(255, 255, 255, 0.06); }
.uploaded-files-list li span { white-space: nowrap; }
.upload-inbox-card { background: rgba(255, 184, 107, 0.08); }
.upload-inbox-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.upload-inbox-header div { display: grid; gap: 0.25rem; }
.upload-inbox-header button { padding: 0.55rem 0.85rem; background: rgba(255, 255, 255, 0.12); color: var(--text); }
.upload-inbox-list { display: grid; gap: 0.6rem; }
.upload-inbox-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.85rem;
  background: rgba(0, 0, 0, 0.16);
}
.upload-inbox-item div { display: grid; gap: 0.25rem; }
.upload-inbox-meta { min-width: 0; }
.upload-card-title { font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
.original-file-name { color: var(--muted); font-size: 0.76rem; overflow-wrap: anywhere; }
.upload-inbox-status { justify-items: end; text-align: right; }
.upload-inbox-item em { color: var(--accent-2); font-size: 0.78rem; font-style: normal; font-weight: 800; text-transform: uppercase; }
.upload-inbox-item time { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.upload-triage-controls {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 0.7fr);
  gap: 0.55rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.upload-triage-controls .title-field,
.upload-triage-controls .summary-field,
.upload-triage-controls .use-notes-field { grid-column: 1 / -1; }
.upload-triage-controls label { display: grid; gap: 0.3rem; color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.upload-triage-controls select,
.upload-triage-controls input,
.upload-triage-controls textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.7rem;
  padding: 0.55rem;
  background: rgba(5, 7, 12, 0.72);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}
.upload-triage-controls textarea { resize: vertical; }
.upload-card-footer {
  grid-column: 1 / -1;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.upload-triage-controls button { padding: 0.55rem 0.8rem; white-space: nowrap; }
.triage-save-status { color: var(--muted); font-size: 0.76rem; }

.paste-context-card {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(0, 0, 0, 0.16);
}
.paste-context-card label { font-weight: 800; }
.paste-context-card textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1rem;
  padding: 0.9rem;
  background: rgba(5, 7, 12, 0.72);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}
.paste-context-card textarea:focus {
  outline: 2px solid rgba(157, 124, 255, 0.55);
  border-color: rgba(157, 124, 255, 0.75);
}
.paste-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.paste-actions span { color: var(--muted); font-size: 0.85rem; }
.saved-context-preview {
  min-height: 2.75rem;
  padding: 0.8rem;
  border-radius: 0.9rem;
  background: rgba(51, 214, 166, 0.08);
  color: #d9fff4;
  font-size: 0.9rem;
}

.tag-grid { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.tag-grid span, .sequence-stack div, .platform-row, .task-card {
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.055);
}
.tag-grid span { padding: 0.7rem 0.85rem; color: #d9dee7; }
.clean-list { display: grid; gap: 0.85rem; padding-left: 1.1rem; color: var(--muted); }
.clean-list strong { color: var(--text); }
.email-sequence-panel { grid-column: span 1; }
.sequence-status {
  align-self: start;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(51, 214, 166, 0.35);
  border-radius: 999px;
  color: #d9fff4;
  background: rgba(51, 214, 166, 0.1);
  font-size: 0.78rem;
  font-weight: 800;
}
.campaign-workspace-panel { margin: 1.25rem 0; }
.campaign-workspace-form { display: grid; gap: 1rem; }
.workspace-hero-grid,
.workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.campaign-workspace-form label,
.workspace-card label,
.sequence-form label,
.sequence-step-card label { display: grid; gap: 0.4rem; color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.campaign-workspace-form input,
.campaign-workspace-form textarea,
.workspace-export-card textarea,
.sequence-form input,
.sequence-step-card input,
.sequence-step-card textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.8rem;
  padding: 0.72rem;
  background: rgba(5, 7, 12, 0.72);
  color: var(--text);
  font: inherit;
}
.sequence-form { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.workspace-notes-field { grid-column: 1 / -1; }
.workspace-status-row,
.workspace-export-card { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.workspace-status-button { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.workspace-status-button.active { background: var(--accent); color: #03100c; }
.workspace-card,
.workspace-export-card {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.055);
}
.workspace-card-header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.workspace-card-header h4,
.workspace-card h4 { margin: 0; }
.workspace-card-header span,
.workspace-export-card span { color: var(--warm); font-size: 0.8rem; font-weight: 800; }
.workspace-card label { grid-template-columns: auto 1fr; align-items: center; color: var(--text); }
.reply-rule-list li { margin-bottom: 0.55rem; }
.workspace-export-card textarea { min-height: 10rem; resize: vertical; }
.sequence-step-card textarea { resize: vertical; line-height: 1.45; }
.sequence-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.sequence-actions button:last-child { background: rgba(255, 255, 255, 0.12); color: var(--text); }
.sequence-stack { display: grid; gap: 0.65rem; }
.sequence-stack div, .platform-row { padding: 0.85rem; }
.sequence-step-card {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.055);
}
.sequence-step-card header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sequence-step-card header span { color: var(--warm); font-size: 0.78rem; font-weight: 900; text-transform: uppercase; }
.platform-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.65rem; }
.platform-row em { color: var(--muted); font-size: 0.8rem; font-style: normal; }

.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.column { min-height: 13rem; padding: 0.9rem; border-radius: 1rem; background: rgba(0, 0, 0, 0.15); }
.task-card { padding: 0.9rem; margin-bottom: 0.7rem; color: #e8edf5; }
.task-card.accent { border-color: rgba(51, 214, 166, 0.4); background: rgba(51, 214, 166, 0.12); }
.progress-timeline { border-left: 2px solid var(--accent); padding-left: 1rem; }
time { color: var(--warm); font-weight: 800; }
.progress-timeline p { margin-bottom: 0; color: var(--muted); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar-card { position: static; margin-top: 1.5rem; }
  .hero, .two-column, .three-column, .board, .workspace-hero-grid, .workspace-grid { grid-template-columns: 1fr; }
  .upload-inbox-header,
  .upload-inbox-item { align-items: start; grid-template-columns: 1fr; }
  .upload-inbox-status { justify-items: start; text-align: left; }
  .upload-triage-controls { grid-template-columns: 1fr; }
}
