/* In-project setup desk (Lane FE-1 owns this file). */
.draft-workspace { margin-block-end: 32px; }
.draft-project-head {
  display: grid; grid-template-columns: max-content max-content minmax(0, 1fr) auto; align-items: center;
  column-gap: 12px; row-gap: 0; min-height: 58px; padding-block: 5px; margin-block-end: 6px;
}
.draft-library-link {
  min-height: 44px; display: inline-flex; align-items: center; font-size: var(--fs-sm); color: var(--text-2);
}
.draft-library-link:hover { color: var(--text-1); text-decoration: underline; text-underline-offset: 3px; }
.draft-crumb-separator { font-size: var(--fs-base); font-weight: 400; color: var(--text-3); }
.draft-status, .draft-nav-bottom > span, .draft-text-action, .draft-back,
.draft-sample summary, .draft-sources-summary p:has(> svg), .draft-recovery {
  display: flex; align-items: center; gap: 8px;
}
.draft-status { gap: 6px; color: var(--text-2); font-size: var(--fs-xs); line-height: 1.4; max-width: 26ch; }
.draft-status svg { color: var(--text-3); flex: none; }
.draft-title { min-width: 0; margin: 0; font-size: clamp(1rem, 1.35vw, 1.18rem); line-height: 1.4; font-weight: 600;
  letter-spacing: -.016em; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.draft-title-row { min-width: 0; display: flex; align-items: center; gap: 2px; }
.draft-edit-name { display: inline-grid; place-items: center; padding: 0; width: 44px; height: 44px; flex: none; color: var(--text-2); background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.draft-edit-name:hover, .draft-edit-name:focus-visible { color: var(--text-1); background: var(--surface-2); }
.draft-name-form { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; width: 100%; max-width: 540px; }
.draft-name-form input { min-width: 0; width: 100%; }
.draft-name-form input, .draft-name-form .btn, .draft-name-form .draft-back { min-height: 44px; }
.draft-layout {
  display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr); grid-template-rows: max-content 1fr;
  grid-template-areas: 'steps stage' 'context stage'; gap: 0 clamp(20px, 3vw, 42px); align-items: start;
}
.draft-layout > .draft-stage { grid-area: stage; }
.draft-navigation { grid-area: steps; min-width: 0; }
@media (min-width: 741px) {
  .draft-navigation, .draft-layout > .draft-stage { align-self: first baseline; }
}
.draft-navigation ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.draft-step, .draft-back, .draft-text-action {
  font: inherit; color: var(--text-2); background: transparent; border: 0; cursor: pointer; text-align: start;
}
.draft-step {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 7px 12px;
  border-inline-start: 2px solid transparent; font-size: var(--fs-base); font-weight: 500;
}
.draft-step[aria-current=step] { color: var(--text-1); background: var(--surface-2); border-inline-start-color: var(--accent-text); font-weight: 600; }
.draft-step:hover, .draft-step:focus-visible { color: var(--text-1); background: var(--surface-hover); }
.draft-step-index { color: var(--text-3); font-size: var(--fs-xs); letter-spacing: .04em; }
.draft-step[aria-current=step] .draft-step-index { color: var(--accent-text); }
.draft-nav-bottom { grid-area: context; border-block-start: 1px solid var(--border); margin-block-start: 14px; padding: 8px 6px; display: grid; gap: 2px; }
.draft-nav-bottom > span { align-items: start; overflow-wrap: anywhere; color: var(--text-3); font-size: var(--fs-xs); }
.draft-nav-bottom > span svg { margin-top: 2px; }
.draft-text-action, .draft-back { width: fit-content; min-height: 36px; min-width: 36px; font-size: var(--fs-sm); padding: 4px 6px; }
.draft-nav-bottom .draft-text-action { min-height: 44px; }
.draft-text-action:hover, .draft-back:hover { color: var(--text-1); text-decoration: underline; text-underline-offset: 3px; }
.draft-stage { min-width: 0; container-type: inline-size; }
.draft-stage-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 14px; }
.draft-step-position { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; }
.draft-stage-head h2 {
  margin: 0; font-size: clamp(1.65rem, 2.65vw, 2.25rem); line-height: 1.2;
  letter-spacing: -.045em; text-wrap: balance; scroll-margin-block-start: 90px;
}
.draft-stage-head h2:focus { outline: none; }
.draft-stage-head p, .draft-sample p, .draft-ref-preview p, .draft-input-note, .draft-inline-msg, .draft-estimate {
  color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5;
}
.draft-stage-head p { grid-column: 1 / -1; margin: 0; }
.draft-stage-content { margin-block: 16px 12px; }
.draft-stage-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-block-start: 16px; }
.draft-stage-footer .btn { white-space: normal; text-align: center; min-height: 44px; padding-block: 7px; max-width: 100%; }
.draft-stage-footer .draft-back { min-height: 44px; }
.draft-estimate { font-size: var(--fs-xs); max-width: 36ch; }
.draft-fields, .draft-reference-editor { display: grid; gap: 16px; }
.draft-fields { max-width: 680px; }
.draft-kit-box { display: grid; gap: 4px; margin-bottom: 12px; }
.draft-kit-note { color: var(--ok); font-size: var(--fs-xs); }
.draft-kit-note:empty { display: none; }
.draft-stage label.draft-field > span, .draft-reference-editor label.field > span { color: var(--text-1); font-size: var(--fs-sm); }
.draft-field > small { color: var(--text-3); font-size: var(--fs-xs); }
.draft-field textarea { min-height: 110px; }
.draft-brief-grid {
  --frame-height: clamp(115px, 17cqi, 165px);
  display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) calc(2 * var(--frame-height));
  grid-template-areas: 'field sample' 'action sample'; grid-template-rows: max-content 1fr; column-gap: 24px;
}
.draft-brief-input { grid-area: field; }
.draft-brief-grid > :is(.draft-sample, .draft-ref-preview) { grid-area: sample; }
.draft-brief-grid .draft-stage-footer { grid-area: action; }
.draft-brief-grid .draft-field textarea { display: block; height: var(--frame-height); }
.draft-brief-grid label.draft-field > span {
  display: flex; align-items: center; min-height: 28px; margin-block: 0 4px;
}
.draft-input-note:not(:empty), .draft-inline-msg:not(:empty) { display: block; margin-block-start: 6px; }
.draft-sample { margin: 0; min-width: 0; }
.draft-sample summary {
  display: inline-flex; align-items: center; min-height: 36px; min-width: 36px; margin-block: 0 4px;
  width: fit-content; color: var(--text-2); font-size: var(--fs-sm); cursor: pointer; list-style: none;
}
.draft-sample summary::-webkit-details-marker { display: none; }
.draft-sample summary::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); margin-block-end: 3px; }
.draft-sample[open] summary::after { transform: rotate(225deg); margin-block: 3px 0; }
.draft-sample img { display: block; width: 100%; height: auto; aspect-ratio: 2/1; border-radius: var(--r-ctl); }
.draft-sample p { margin: 7px 0 0; color: var(--text-3); font-size: var(--fs-xs); }
.draft-assets { display: grid; border-block-start: 1px solid var(--border); }
.draft-asset { min-width: 0; border-block-end: 1px solid var(--border); }
.draft-asset-toggle {
  width: 100%; min-height: 74px; padding: 12px 3px; display: flex; align-items: center; gap: 13px;
  background: none; border: 0; text-align: start; color: var(--text-1); cursor: pointer;
}
.draft-asset-toggle:hover { background: var(--surface-hover); }
.draft-asset-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--r-ctl); background: var(--surface-2); }
.draft-asset-copy { display: grid; gap: 2px; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.draft-asset-copy strong { font-size: var(--fs-base); }
.draft-asset-copy > span { font-size: var(--fs-sm); color: var(--text-2); }
.draft-asset-content { padding: 0 4px 16px; }
.draft-asset-content .project-assets { margin: 0; }
.draft-asset-content .project-section-head { margin: 0 0 10px; }
.draft-asset-content .project-section-head > div { display: none; }
.draft-reference-editor { gap: 10px; justify-items: start; }
.draft-reference-editor .reference-fields { width: 100%; }
.draft-ref-preview { display: grid; gap: 8px; margin: 0; min-width: 0; }
.draft-ref-preview img { max-width: 100%; max-height: 150px; border-radius: var(--r-ctl); object-fit: contain; }
.draft-ref-preview figcaption { overflow-wrap: anywhere; font-size: var(--fs-sm); }
.draft-ref-preview p { margin: 1px 0 0; }
.draft-asset-content .draft-ref-preview { margin: 0 0 12px; }
.draft-review { display: grid; }
.draft-review-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-block-start: 1px solid var(--border); padding: 14px 0; }
.draft-review-row > div { min-width: 0; }
.draft-review-row h3 { font-size: var(--fs-sm); margin: 0 0 4px; }
.draft-review-row p { font-size: var(--fs-base); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; margin: 3px 0; }
.draft-review-row .draft-text-action { flex: 0 0 auto; min-height: 36px; }
.draft-sources-summary { display: grid; gap: 6px; }
.draft-photo-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 6px; }
.draft-photo-strip img { width: 62px; height: 62px; object-fit: cover; border-radius: var(--r-ctl); }
.draft-feedback:empty { display: none; }
.draft-feedback { margin-block: 0 16px; }
.draft-recovery { flex-wrap: wrap; }
.draft-conflict-value { margin-block-start: 5px; font-size: var(--fs-sm); }
.draft-conflict-value > p { margin: 2px 0; max-height: 100px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
[dir=rtl] .draft-stage-head h2, [dir=rtl] .draft-title { letter-spacing: normal; line-height: 1.42; }
@media (max-width: 1049px) {
  .draft-brief-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'field' 'sample' 'action'; grid-template-rows: auto; gap: 4px; }
  .draft-brief-grid .draft-stage-footer { margin-block-start: 4px; }
  .draft-brief-grid .draft-field textarea { height: 110px; }
  .draft-sample summary { margin-block: 0; min-height: 44px; }
  .draft-sample img { max-width: 440px; }
}
@media (max-width: 740px) {
  .draft-project-head { min-height: 50px; column-gap: 7px; margin-block-end: 5px; padding-block: 2px; }
  .draft-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto;
    grid-template-areas: 'steps' 'stage' 'context'; gap: 12px; }
  .draft-navigation { padding: 0; }
  .draft-navigation ol { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
  .draft-step { gap: 3px; padding: 6px 4px; flex-direction: column; border-inline-start: 0; border-block-end: 2px solid var(--border); font-size: var(--fs-sm); }
  .draft-step[aria-current=step] { border-block-end-color: var(--accent-text); }
  .draft-nav-bottom { margin: 0; padding: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; }
  .draft-nav-bottom .draft-text-action { font-size: var(--fs-xs); }
  .draft-stage-head { display: block; }
  .draft-stage-head h2 { font-size: clamp(1.5rem, 5.5vw, 1.9rem); }
  .draft-step-position { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .draft-stage-content { margin-block: 10px 8px; }
  .draft-estimate { order: -1; flex-basis: 100%; max-width: none; }
}
@media (max-width: 480px) {
  .draft-project-head { grid-template-columns: max-content max-content minmax(0, 1fr); padding-block: 1px 7px; }
  .draft-status { grid-column: 1 / -1; max-width: 100%; }
  .draft-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow-wrap: anywhere; }
  .draft-title-row:has(.draft-name-form) { grid-column: 1 / -1; }
  .draft-project-head:has(.draft-name-form) .draft-crumb-separator { display: none; }
  .draft-project-head:has(.draft-name-form) .draft-status { grid-column: 3; grid-row: 1; justify-self: end; }
  .draft-name-form { margin-block-end: 6px; }
}
@media (max-width: 375px) {
  .draft-stage-footer { gap: 6px; }
  .draft-stage-footer .btn { padding-inline: 12px; }
  .draft-asset-toggle { gap: 8px; }
}
