/* ChalkboardAI pilot dashboard, matched to the landing page visual system */
:root {
  --forest: #173f35;
  --forest-dark: #0d2f28;
  --green: #2f6f5d;
  --mint: #dcefe6;
  --mint-soft: #eff8f2;
  --cream: #f8f3e8;
  --card: #fffdf7;
  --text: #1d2d2a;
  --muted: #52655f;
  --border: #d7e2d8;
  --border-strong: #b9d0c3;
  --success: #1b9b6b;
  --warning: #f1d69a;
  --warning-text: #6b4e16;
  --shadow: 0 18px 45px rgba(18, 51, 43, 0.12);
  --shadow-soft: 0 12px 26px rgba(18, 51, 43, 0.09);
  --radius: 8px;
  --max: 1120px;

  --chalkboard: var(--forest);
  --chalkboard-deep: var(--forest-dark);
  --paper: var(--card);
  --ink: var(--text);
  --line: var(--border);
  --ok: var(--success);
  --warn: var(--warning);
  --warn-ink: var(--warning-text);
  --lock: rgba(29, 45, 42, 0.48);
  --bg: var(--cream);
  --panel: var(--card);
  --brand-900: var(--forest);
  --brand-800: var(--forest-dark);
  --brand-600: var(--forest);
  --brand-500: var(--forest-dark);
  --radius-lg: var(--radius);
  --radius-md: var(--radius);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(circle at top left, rgba(220, 239, 230, 0.92), transparent 34rem),
    linear-gradient(180deg, var(--cream) 0%, #fbf8ef 52%, var(--card) 100%);
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #9fd5bb;
  outline-offset: 3px;
}

/* Product shell */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  color: var(--forest-dark);
  border-bottom: 1px solid rgba(215, 226, 216, 0.9);
  background: rgba(248, 243, 232, 0.94);
  backdrop-filter: blur(14px);
}

.topbar__inner {
  width: min(var(--max), calc(100% - 40px));
  min-height: 74px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--forest-dark);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand__mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  color: #f5fbf6;
  font-weight: 900;
  background: linear-gradient(145deg, var(--forest), var(--green));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brand__mark::before {
  content: "C";
}

.brand__mark::after {
  content: none;
}

.brand__text {
  display: grid;
  line-height: 1.08;
}

.brand__name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand__tagline {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.user {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.user__avatar {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background:
    linear-gradient(145deg, rgba(220, 239, 230, 0.84), rgba(255, 253, 247, 0.92));
}

.cb-app .user__button {
  appearance: none;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.76);
  color: var(--forest-dark);
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cb-app .user__button:hover {
  background: #fff;
  box-shadow: 0 10px 20px rgba(23, 63, 53, 0.1);
}

.user__chev {
  color: var(--muted);
  font-size: 0.78rem;
}

.pilot-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.98);
  box-shadow: var(--shadow-soft);
  color: var(--text);
}

.pilot-menu[hidden] {
  display: none;
}

.pilot-menu__eyebrow,
.pilot-menu__section-title {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pilot-menu__code {
  margin: 0 0 14px;
  color: var(--forest-dark);
  font-size: 0.98rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.pilot-menu__usage {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--mint-soft);
}

.pilot-menu dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.pilot-menu dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.pilot-menu dt {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.pilot-menu dd {
  margin: 0;
  color: var(--forest-dark);
  font-size: 1rem;
  font-weight: 850;
}

.pilot-menu__privacy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

/* Page layout */
.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 46px;
}

.section {
  margin: 0 0 64px;
}

.section:first-child {
  margin-bottom: 72px;
}

.h1,
.h2,
.h3 {
  color: var(--forest-dark);
  line-height: 1.08;
  letter-spacing: 0;
}

.h1 {
  max-width: 760px;
  margin: 0 0 28px;
  font-size: clamp(2.35rem, 4.8vw, 4.4rem);
  font-weight: 850;
}

.h1--sm {
  margin: 0 0 22px;
  font-size: clamp(2rem, 3.4vw, 3.2rem);
}

.h2 {
  margin: 0 0 6px;
  font-size: 1.16rem;
  font-weight: 850;
}

.h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 850;
}

.muted {
  margin: 0 0 16px;
  color: var(--muted);
}

/* Cards */
.card,
.toolCard {
  border: 1px solid rgba(215, 226, 216, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--shadow);
}

.card__body {
  padding: 24px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  position: relative;
}

.step__content {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.step__titleRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.step__titleRow .h2 {
  flex: 1 1 9rem;
  min-width: 0;
}

.step__titleRow .pill {
  flex: 0 1 auto;
}

/* Workflow */
.steps {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    28px
    minmax(0, 1fr)
    28px
    minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  margin: 0 0 28px;
}

.card.step {
  width: 100%;
  min-height: 228px;
}

.card.step .card__body {
  height: 100%;
}

.step--locked {
  background: rgba(255, 253, 247, 0.86);
}

.step--locked .step__icon {
  opacity: 0.78;
}

.step-unlock-note {
  margin: 12px 0 0;
  font-size: 0.92rem;
}

.arrow {
  display: grid;
  place-items: center;
  color: rgba(47, 111, 93, 0.42);
  font-size: 1.15rem;
  font-weight: 850;
  line-height: 1;
}

/* Intentional icon tiles */
.step__icon,
.toolCard__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #c9ddcf;
  border-radius: var(--radius);
  background: var(--mint-soft);
  color: var(--forest-dark);
}

.step__icon {
  width: 52px;
  height: 52px;
  position: relative;
}

.step__icon::before,
.step__icon::after {
  content: "";
  position: absolute;
}

.step__icon--file::after {
  width: 20px;
  height: 24px;
  border: 2px solid rgba(47, 111, 93, 0.54);
  border-radius: 5px;
  background: rgba(255, 253, 247, 0.72);
}

.step__icon--file::before {
  width: 12px;
  height: 2px;
  background: rgba(47, 111, 93, 0.42);
  transform: translateY(7px);
}

.step__icon--user::after {
  top: 13px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(47, 111, 93, 0.42);
}

.step__icon--user::before {
  bottom: 12px;
  width: 28px;
  height: 13px;
  border-radius: 999px 999px 6px 6px;
  background: rgba(47, 111, 93, 0.2);
}

.step__icon--lock::after {
  bottom: 13px;
  width: 20px;
  height: 16px;
  border-radius: 5px;
  background: rgba(47, 111, 93, 0.24);
}

.step__icon--lock::before {
  top: 13px;
  width: 16px;
  height: 13px;
  border: 2px solid rgba(47, 111, 93, 0.42);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

/* Buttons and pills */
.cb-app .btn {
  appearance: none;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 16px;
  font: inherit;
  font-weight: 760;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.cb-app .btn:hover {
  transform: translateY(-1px);
}

.cb-app .btn--primary {
  background: var(--forest);
  border-color: var(--forest);
  color: #fffdf7;
  box-shadow: 0 12px 22px rgba(23, 63, 53, 0.18);
}

.cb-app .btn--primary:hover {
  background: var(--forest-dark);
  border-color: var(--forest-dark);
}

.cb-app .btn--ghost,
.cb-app .btn--warn {
  border-color: var(--border-strong);
  background: rgba(255, 253, 247, 0.76);
  color: var(--forest-dark);
}

.cb-app .btn--ghost:hover,
.cb-app .btn--warn:hover {
  background: #fff;
  box-shadow: 0 10px 20px rgba(23, 63, 53, 0.1);
}

.cb-app .btn[disabled],
.cb-app .btn[aria-disabled="true"] {
  border-color: rgba(185, 208, 195, 0.72);
  background: rgba(255, 253, 247, 0.62);
  color: rgba(82, 101, 95, 0.88);
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.pill--ok {
  border-color: rgba(27, 155, 107, 0.28);
  color: var(--forest-dark);
}

.pill--soon,
.pill--locked {
  opacity: 0.92;
}

.pill--warn {
  border-color: rgba(107, 78, 22, 0.24);
  background: rgba(241, 214, 154, 0.28);
  color: var(--warning-text);
}

.dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(29, 45, 42, 0.42);
}

.dot--ok {
  background: var(--success);
}

.dot--warn {
  background: var(--warning-text);
}

.dot--lock {
  background: rgba(29, 45, 42, 0.42);
}

/* Name check */
.namecheckCard {
  margin: 0 0 28px;
}

.namecheckCard .card__body,
.preview .card__body {
  display: grid;
  gap: 16px;
}

.namecheck-inner {
  width: 100%;
}

.nameCheckPanel {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--mint-soft);
}

.nameCheckPanel__summary {
  margin-bottom: 12px;
  color: var(--forest-dark);
  font-weight: 760;
}

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

.nameCheckList {
  display: grid;
  gap: 10px;
}

.nameCheckList__title,
.nameCheckGroupTitle {
  color: var(--forest-dark);
  font-weight: 850;
}

.nameCheckList__title {
  margin-bottom: 8px;
}

.nameCheckGroupTitle {
  margin: 10px 0 6px;
}

.nameCheckGroup {
  margin-bottom: 12px;
}

.nameCheckItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.nameCheckItem__left {
  display: grid;
  gap: 2px;
}

.nameCheckItem__meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.nameCheckItem__actions {
  display: inline-flex;
  gap: 8px;
}

/* Preview panel */
.preview {
  margin-top: 0;
}

.preview .card__body {
  padding: 26px;
}

.preview .h2 {
  margin: 0;
}

.status {
  min-height: 84px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 18px;
  border: 1px dashed #c9ddcf;
  border-radius: var(--radius);
  background: rgba(239, 248, 242, 0.72);
  color: var(--muted);
  text-align: center;
}

.status--ok {
  min-height: auto;
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 10px;
  border-style: solid;
  border-color: rgba(27, 155, 107, 0.28);
  background: #fff;
  text-align: left;
}

.status__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(27, 155, 107, 0.14);
}

.table-wrap {
  width: 100%;
  max-height: 65vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.table-wrap:has(#table-container:empty) {
  display: none;
}

#table-container table {
  width: max-content;
  border-collapse: collapse;
}

#table-container th,
#table-container td {
  max-width: 260px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
}

#table-container th {
  background: var(--mint-soft);
  color: var(--forest-dark);
  font-weight: 850;
}

#table-container td {
  cursor: default;
  user-select: text;
}

.flash {
  outline: 3px solid rgba(47, 111, 93, 0.3);
  outline-offset: -2px;
}

.cell-flag {
  font-weight: 760;
  border-left: 4px solid transparent;
}

.cell-flag--blocked {
  background: rgba(241, 214, 154, 0.42);
  border-left-color: rgba(107, 78, 22, 0.38);
}

.cell-flag--optional {
  background: rgba(241, 214, 154, 0.22);
  border-left-color: rgba(107, 78, 22, 0.18);
}

.cell-focus {
  outline: 3px solid rgba(47, 111, 93, 0.28);
  outline-offset: -2px;
}

.row-focus td {
  background-image: linear-gradient(rgba(47, 111, 93, 0.08), rgba(47, 111, 93, 0.08));
}

/* Tool cards */
.toolGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.toolCard {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.toolCard:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 22px 46px rgba(18, 51, 43, 0.14);
}

.toolCard__icon {
  width: 46px;
  height: 46px;
  font-size: 1.15rem;
  font-weight: 850;
}

.toolCard__meta {
  min-width: 0;
}

.toolCard .h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toolCard__cta {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.76);
  color: var(--forest-dark);
  font-weight: 760;
}

.toolCard:hover .toolCard__cta {
  background: #fff;
}

.toolCard--soon {
  opacity: 0.82;
}

.footer {
  margin-top: 26px;
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.hidden-file-input {
  display: none;
}

@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr;
    max-width: 620px;
  }

  .arrow {
    display: none;
  }
}

@media (max-width: 980px) {
  .toolGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar__inner {
    flex-wrap: wrap;
    justify-content: center;
    padding: 16px 0;
  }

  .user {
    margin-left: 0;
  }

  .pilot-menu {
    right: 0;
  }

  .nameCheckPanel__lists {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar__inner,
  .wrap {
    width: min(100% - 28px, var(--max));
  }

  .wrap {
    padding-top: 36px;
  }

  .section,
  .section:first-child {
    margin-bottom: 48px;
  }

  .brand__tagline {
    display: none;
  }

  .cb-app .user__button {
    max-width: calc(100vw - 88px);
  }

  .user__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .card__body {
    padding: 20px;
    flex-direction: column;
  }

  .preview .card__body {
    padding: 20px;
  }

  .toolGrid {
    grid-template-columns: 1fr;
  }
}
