/* TOKCAD: styles for TOK CAD's start screen and coach, matching the studio's dark theme. */
#bw-welcome { display: none !important; }      /* replaced by the TOK CAD start screen */

.tokcad-start {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(6, 10, 16, .72); backdrop-filter: blur(3px);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; color: #e9edf2;
}
.tokcad-start.is-dragging .tokcad-drop { border-color: #a9d1ff; background: rgba(169, 209, 255, .08); }
.tokcad-start-card {
  width: min(860px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  background: #141a22; border: 1px solid #2c3743; border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55); padding: 28px 32px 20px;
}
.tokcad-start header { margin-bottom: 18px; }
.tokcad-start h1, .tokcad-start h2 { font-family: inherit; border: 0; padding: 0; letter-spacing: normal; }
.tokcad-start h1 { margin: 6px 0 4px; font-size: 28px; line-height: 1.15; }
.tokcad-start h2 { margin: 22px 0 10px; font-size: 15px; color: #aeb7c3; font-weight: 600; }
.tokcad-sub { margin: 0; color: #aeb7c3; }
.tokcad-start-body { display: flex; flex-direction: column; gap: 16px; }

.tokcad-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 30px 20px; border: 2px dashed #3d4c5c; border-radius: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tokcad-drop:hover, .tokcad-drop:focus-visible { border-color: #6fa8e8; background: rgba(111, 168, 232, .06); outline: none; }
.tokcad-drop-icon { font-size: 34px; color: #85bcf4; line-height: 1; }
.tokcad-drop strong { font-size: 18px; }
.tokcad-drop span { color: #aeb7c3; font-size: 13px; }

.tokcad-choices, .tokcad-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.tokcad-choice, .tokcad-shape {
  display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
  padding: 16px 18px; border: 1px solid #2c3743; border-radius: 10px;
  background: #1a222c; color: inherit; font: inherit;
  transition: border-color .15s, background .15s;
}
.tokcad-choice:hover:not(:disabled), .tokcad-shape:hover { border-color: #6fa8e8; background: #1d2834; }
.tokcad-choice:disabled { opacity: .55; cursor: default; }
.tokcad-choice strong { font-size: 16px; }
.tokcad-choice span { color: #aeb7c3; font-size: 13px; }
.tokcad-choice em { color: #85bcf4; font-size: 13px; font-style: normal; margin-top: 4px; }
.tokcad-choice-big { padding: 20px 22px; }

.tokcad-shapes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tokcad-shape { align-items: center; text-align: center; padding: 12px; }
.tokcad-art svg { width: 100%; height: auto; max-height: 80px; fill: none; stroke: #85bcf4; stroke-width: 2; stroke-linejoin: round; }
.tokcad-art-big svg { max-height: 120px; }

.tokcad-form { display: flex; flex-direction: column; gap: 12px; }
.tokcad-form p { margin: 0; }
.tokcad-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.tokcad-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #aeb7c3; }
.tokcad-unit { display: flex; align-items: center; gap: 6px; color: #e9edf2; }
.tokcad-unit input {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 6px;
  border: 1px solid #3a4655; background: #0f141a; color: #e9edf2; font: inherit;
}
.tokcad-unit input:focus { border-color: #6fa8e8; outline: none; }
.tokcad-note { color: #aeb7c3; font-size: 13px; }
.tokcad-error { color: #ff9b9b; min-height: 1.2em; font-size: 14px; }

.tokcad-btn {
  display: inline-block; margin-top: 6px; padding: 8px 16px; border-radius: 6px; cursor: pointer;
  border: 1px solid #6e7b8c; background: #262d36; color: #f5f7fa; font: inherit; font-weight: 600;
}
.tokcad-primary { align-self: flex-start; background: #a9d1ff; border-color: #a9d1ff; color: #07121d; }
.tokcad-back, .tokcad-link {
  background: none; border: 0; padding: 0; color: #9fc8ff; font: inherit; cursor: pointer;
}
.tokcad-back { font-size: 13px; }
.tokcad-start footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 22px; padding-top: 14px; border-top: 1px solid #2c3743; font-size: 13px; color: #aeb7c3;
}
.tokcad-hide { display: flex; align-items: center; gap: 6px; cursor: pointer; }

#tokcad-start-open {
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline;
  padding: 0 8px;
}

@media (max-width: 600px) {
  .tokcad-start-card { padding: 20px 18px 16px; }
  .tokcad-start h1 { font-size: 22px; }
}

/* ── Engineering coach (top of the right-hand panel) ───────────────────────────────────── */
.tokcad-coach {
  margin: 8px 8px 10px; border: 1px solid #2c3743; border-radius: 8px; background: #141a22;
  font: 13px/1.45 Inter, ui-sans-serif, system-ui, sans-serif; color: #e9edf2;
}
.tokcad-coach header { display: flex; align-items: center; border-bottom: 1px solid #2c3743; }
.tokcad-coach-toggle {
  flex: 1; display: flex; gap: 6px; align-items: baseline; padding: 9px 10px; text-align: left;
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
}
.tokcad-coach-toggle span { color: #85bcf4; }
.tokcad-coach-close { background: none; border: 0; color: #aeb7c3; font-size: 18px; padding: 4px 10px; cursor: pointer; }
.tokcad-steps { list-style: none; margin: 0; padding: 4px 0; }
.tokcad-step-head {
  width: 100%; display: flex; gap: 8px; align-items: center; padding: 6px 10px; text-align: left;
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
}
.tokcad-step-head:hover { background: #1a222c; }
.tokcad-step-head small { margin-left: auto; color: #7d8794; font-size: 11px; }
.tokcad-mark {
  flex: 0 0 18px; height: 18px; border-radius: 50%; border: 1.5px solid #4a5868;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #07121d;
}
.tokcad-step.is-done .tokcad-mark { background: #7fd1a0; border-color: #7fd1a0; }
.tokcad-step.is-na .tokcad-mark { border-style: dashed; color: #7d8794; }
.tokcad-step.is-done .tokcad-step-head > span:nth-child(2) { color: #aeb7c3; }
.tokcad-step.is-open .tokcad-step-head { color: #fff; font-weight: 600; }
.tokcad-step-body { padding: 2px 12px 10px 36px; display: flex; flex-direction: column; gap: 8px; }
.tokcad-step-body p, .tokcad-step-body ul { margin: 0; color: #c9d1db; }
.tokcad-step-body ul { padding-left: 18px; }
.tokcad-hint { color: #85bcf4 !important; }
.tokcad-why summary { cursor: pointer; color: #9fc8ff; }
.tokcad-why p { margin-top: 6px !important; color: #aeb7c3 !important; }
.tokcad-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tokcad-actions .tokcad-btn, .tokcad-intent .tokcad-btn { margin-top: 0; padding: 5px 10px; font-size: 12px; }
.tokcad-intent { display: flex; flex-direction: column; gap: 8px; }
.tokcad-intent label { display: flex; flex-direction: column; gap: 3px; color: #aeb7c3; }
.tokcad-intent input[type=text] {
  padding: 6px 8px; border-radius: 5px; border: 1px solid #3a4655; background: #0f141a; color: #e9edf2; font: inherit;
}
.tokcad-intent fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tokcad-intent legend { color: #aeb7c3; margin-bottom: 3px; padding: 0; }
.tokcad-radio { flex-direction: row !important; align-items: center; gap: 6px !important; color: #e9edf2 !important; cursor: pointer; }
#tokcad-coach-open {
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; padding: 0 8px;
}

/* ── Beginner / Expert ─────────────────────────────────────────────────────────────────── */
body.tokcad-beginner .tokcad-adv { display: none !important; }
body:not(.tokcad-beginner) .tokcad-beginner-only { display: none !important; }
.tokcad-mode { display: inline-flex; align-self: flex-start; border: 1px solid #3a4655; border-radius: 8px; overflow: hidden; }
.tokcad-seg {
  padding: 6px 16px; background: #1a222c; color: #aeb7c3; border: 0; font: inherit; font-weight: 600; cursor: pointer;
}
.tokcad-seg + .tokcad-seg { border-left: 1px solid #3a4655; }
.tokcad-seg.is-on { background: #a9d1ff; color: #07121d; }
.tokcad-continue { border-color: #4f7fb0; }
#tokcad-mode-toggle {
  background: none; border: 0; color: #85bcf4; font: inherit; cursor: pointer; text-decoration: underline; padding: 0 8px;
}

/* ── Molding check (below the coach) ───────────────────────────────────────────────────── */
.tokcad-mold header { padding-left: 10px; }
.tokcad-mold header b { flex: 1; padding: 9px 0; }
.tokcad-mold-body { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.tokcad-mold-body p, .tokcad-mold-body ul { margin: 0; color: #c9d1db; }
.tokcad-mold-body .tokcad-btn { margin-top: 0; padding: 5px 12px; font-size: 12px; }
.tokcad-mold-body .tokcad-error, .tokcad-mold-body .tokcad-note { font-size: 13px; }
.tokcad-mold-body .tokcad-error a { color: #9fc8ff; }
.tokcad-mold-pull { display: flex; align-items: center; gap: 8px; color: #aeb7c3; }
.tokcad-mold-pull select {
  flex: 1; padding: 4px 6px; border-radius: 5px; border: 1px solid #3a4655; background: #0f141a; color: #e9edf2; font: inherit;
}
.tokcad-mold-views { display: flex; flex-wrap: wrap; gap: 4px; }
.tokcad-mold-tab {
  padding: 4px 8px; border-radius: 5px; border: 1px solid #3a4655; background: #1a222c; color: #aeb7c3;
  font: inherit; font-size: 12px; cursor: pointer;
}
.tokcad-mold-tab.is-on { background: #a9d1ff; border-color: #a9d1ff; color: #07121d; font-weight: 600; }
.tokcad-legend { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.tokcad-legend li { display: flex; align-items: center; gap: 6px; }
.tokcad-swatch { flex: 0 0 12px; height: 12px; border-radius: 3px; }
.tokcad-finding ul { padding-left: 18px; }
#tokcad-mold-open {
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; padding: 0 8px;
}
