:root {
  --ink: #243033;
  --muted: #667275;
  --line: #dce5e2;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --soft: #edf6f3;
  --teal: #087b75;
  --teal-2: #0f9d91;
  --coral: #e46b55;
  --gold: #d9a441;
  --graphite: #344447;
  --shadow: 0 18px 45px rgba(36, 48, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: #233235;
  color: #f7fbfa;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-mark,
.icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal-2);
  color: white;
  flex: 0 0 auto;
}

.brand-mark svg,
.icon-box svg,
.tiny-icon svg,
.tool-button svg,
.copy-btn svg,
.nav-item svg,
.profile-btn svg,
.primary svg,
.secondary svg,
.ghost svg,
.status-pill svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.trial-box {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 8px;
}

.trial-box strong {
  display: block;
  margin-bottom: 6px;
}

.trial-box p,
.helper,
.small {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.sidebar .helper {
  color: #c4d0ce;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dce9e7;
  background: transparent;
  border-radius: 8px;
  padding: 10px;
  text-align: left;
}

.nav-item.active {
  background: rgba(15, 157, 145, 0.23);
  color: white;
}

.main {
  min-width: 0;
  padding: 24px;
}

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

.mobile-menu {
  display: none;
}

.headline h1 {
  margin: 0 0 6px;
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  line-height: 1.05;
}

.headline p {
  max-width: 720px;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-btn,
.primary,
.secondary,
.ghost,
.danger {
  min-height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 14px;
  font-weight: 750;
  white-space: nowrap;
}

.primary {
  background: var(--teal);
  color: white;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.secondary {
  background: #e7f2ef;
  color: var(--teal);
}

.compact-copy {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.88rem;
}

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

.danger {
  background: #fff0ed;
  color: #a23f31;
}

.profile-btn {
  background: white;
  color: var(--graphite);
  box-shadow: 0 1px 0 rgba(36, 48, 51, 0.08);
  border: 1px solid var(--line);
}

.grid {
  display: grid;
  gap: 18px;
}

.dashboard {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: start;
}

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

.welcome-art {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  display: block;
}

.welcome-copy {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.welcome-copy h2,
.panel h2,
.step-title h2 {
  margin: 0;
  font-size: 1.35rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.account-metrics {
  margin-bottom: 18px;
}

.metric {
  background: var(--soft);
  border-radius: 8px;
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 1.5rem;
}

.progress-track {
  height: 12px;
  background: #e7eeec;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 8px;
}

.progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--teal), var(--coral));
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 20px;
}

.step-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  background: #eef4f2;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
}

.step-chip.active {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
}

.workspace {
  max-width: 1120px;
  margin: 0 auto;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f7fbfa, #fbfaf6);
}

.auth-card {
  width: min(560px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.auth-brand {
  color: var(--ink);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.05;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

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

.step-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.step-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
  min-height: 46px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

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

.choice-card,
.topic-card,
.tool-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 128px;
  text-align: left;
  display: grid;
  gap: 9px;
  align-content: start;
  color: var(--ink);
}

.choice-card:hover,
.topic-card:hover,
.tool-card:hover,
.choice-card.selected,
.topic-card.selected,
.tool-card.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 123, 117, 0.12);
}

.choice-card h3,
.topic-card h3,
.tool-card h3 {
  margin: 0;
  font-size: 1rem;
}

.choice-card p,
.topic-card p,
.tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.script-section,
.prompt-box,
.history-item,
.check-item {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 14px;
}

.script-section + .script-section,
.prompt-box + .prompt-box,
.history-item + .history-item,
.check-item + .check-item,
.admin-user + .admin-user {
  margin-top: 10px;
}

.admin-user {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 14px;
}

.admin-user-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.admin-user h3 {
  margin: 0 0 6px;
}

.admin-user-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-head,
.history-head,
.check-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.script-section h3,
.prompt-box h3 {
  margin: 0 0 8px;
}

.script-section p,
.prompt-box p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.prompt-part {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.prompt-part h3 {
  font-size: 0.98rem;
}

.shot-part-card {
  background: #f8fcfb;
}

.prompt-action-card {
  background: #ffffff;
}

.copy-btn,
.tool-button {
  min-width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--graphite);
  background: #fff;
  flex: 0 0 auto;
}

.copy-btn:hover,
.tool-button:hover {
  background: var(--soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff4df;
  color: #7a5615;
  font-weight: 750;
  font-size: 0.84rem;
}

.status-pill.active {
  background: #e3f6f1;
  color: var(--teal);
}

.aside {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
}

.mini-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.mini-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.mini-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tool-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--teal);
  font-weight: 900;
}

.check-item {
  align-items: center;
}

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

.direction-check {
  min-height: 54px;
  background: #f8fcfb;
}

.check-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.check-left input {
  width: 20px;
  min-height: 20px;
  margin-top: 2px;
  accent-color: var(--teal);
}

.section-label {
  margin: 18px 0 10px;
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
  color: var(--muted);
}

.empty {
  min-height: 130px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #223033;
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  z-index: 20;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 34, 36, 0.46);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
}

.modal {
  width: min(760px, 100%);
  max-height: min(820px, 92vh);
  overflow: auto;
  background: var(--paper);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    display: none;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .dashboard,
  .flow-layout {
    grid-template-columns: 1fr;
  }

  .aside {
    position: static;
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .step-title,
  .section-head,
  .history-head {
    flex-direction: column;
    align-items: stretch;
  }

  .actions,
  .toolbar {
    justify-content: stretch;
  }

  .primary,
  .secondary,
  .ghost,
  .danger,
  .profile-btn {
    width: 100%;
  }

  .form-grid,
  .choice-grid,
  .check-grid,
  .metric-row,
  .admin-user-controls {
    grid-template-columns: 1fr;
  }

  .admin-user-head {
    flex-direction: column;
    align-items: stretch;
  }

  .choice-card,
  .topic-card,
  .tool-card {
    min-height: 112px;
  }
}
