/* Asset intake v22: type-first workflow drafting for manual and MCP-assisted input. */

.portal-dialog[data-mode="intake"] {
  width: min(1160px, calc(100vw - 48px));
  max-height: min(900px, calc(100vh - 32px));
  border-color: #393939;
  border-radius: 0;
  background: #0d0d0d;
  color-scheme: dark;
}

.portal-dialog[data-mode="intake"] .portal-dialog-shell {
  max-height: min(900px, calc(100vh - 32px));
}

.portal-dialog[data-mode="intake"] .portal-dialog-header {
  padding: 20px 28px 18px;
  border-bottom-color: #333333;
  background: rgb(13 13 13 / 96%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.portal-dialog[data-mode="intake"] .portal-dialog-header h2 {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.portal-dialog[data-mode="intake"] .portal-dialog-body {
  padding: 0 28px 28px;
}

.asset-intake {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.intake-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.7fr);
  min-width: 0;
  border: 1px solid #333333;
  border-top: 0;
  background:
    linear-gradient(112deg, rgb(255 77 77 / 11%), transparent 48%),
    #111111;
}

.intake-overview > div {
  padding: 28px;
}

.intake-eyebrow,
.intake-section-heading > div > span,
.intake-main-heading > div > span,
.intake-file-summary > span,
.intake-mcp-imports > span {
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.intake-overview h3 {
  max-width: 670px;
  margin: 9px 0 12px;
  color: #f2f2f2;
  font-family: var(--font-heading);
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.intake-overview p,
.intake-section-heading p,
.intake-requirement-rail > p,
.intake-main-heading p,
.intake-form-section header p,
.intake-mcp-intro p,
.intake-mcp-flow p,
.intake-coming-soon p,
.intake-review p {
  margin: 0;
  color: #8d8d8d;
  font-size: 12px;
  line-height: 1.7;
}

.intake-overview > div > p {
  max-width: 700px;
  font-size: 13px;
}

.intake-stage-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-left: 1px solid #2f2f2f;
  list-style: none;
}

.intake-stage-line li {
  position: relative;
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 22px 18px;
  border-right: 1px solid #292929;
  background: rgb(0 0 0 / 12%);
}

.intake-stage-line li:last-child {
  border-right: 0;
}

.intake-stage-line li::before {
  position: absolute;
  top: -1px;
  right: 100%;
  left: 0;
  height: 2px;
  background: var(--brand);
  content: "";
}

.intake-stage-line li.active::before {
  right: 0;
}

.intake-stage-line span {
  color: #666666;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 750;
}

.intake-stage-line strong {
  color: #979797;
  font-size: 12px;
  font-weight: 600;
}

.intake-stage-line li.active span {
  color: var(--brand);
}

.intake-stage-line li.active strong {
  color: #e8e8e8;
}

.intake-type-section {
  display: grid;
  gap: 16px;
}

.intake-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.intake-section-heading > div {
  display: grid;
  gap: 5px;
}

.intake-section-heading h3,
.intake-requirement-rail h3,
.intake-main-heading h3,
.intake-coming-soon h3 {
  margin: 0;
  color: #eeeeee;
  font-family: var(--font-heading);
  font-weight: 620;
  letter-spacing: -0.018em;
}

.intake-section-heading h3 {
  font-size: 20px;
}

.intake-section-heading > p {
  max-width: 390px;
  padding-left: 18px;
  border-left: 1px solid #333333;
}

.intake-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #333333;
}

.intake-type-option {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 12px;
  min-width: 0;
  min-height: 130px;
  padding: 18px;
  border: 0;
  border-right: 1px solid #2d2d2d;
  border-radius: 0;
  background: #111111;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.intake-type-option:last-child {
  border-right: 0;
}

.intake-type-option::before {
  position: absolute;
  top: -1px;
  right: 100%;
  left: 0;
  height: 2px;
  background: var(--brand);
  content: "";
  transition: right 180ms ease;
}

.intake-type-option:hover,
.intake-type-option:focus-visible {
  background: #161616;
}

.intake-type-option:focus-visible {
  z-index: 1;
  outline: 1px solid #6b6b6b;
  outline-offset: -4px;
}

.intake-type-option.active {
  background:
    linear-gradient(130deg, rgb(255 77 77 / 9%), transparent 62%),
    #151313;
}

.intake-type-option.active::before {
  right: 0;
}

.intake-type-code {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #3d3d3d;
  background: #181818;
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.intake-type-option.active .intake-type-code {
  border-color: #673737;
  background: #211717;
}

.intake-type-copy {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.intake-type-copy strong {
  color: #ededed;
  font-size: 14px;
  font-weight: 650;
}

.intake-type-copy small {
  color: #777777;
  font-size: 11px;
  line-height: 1.5;
}

.intake-type-state {
  grid-column: 1 / -1;
  justify-self: start;
  color: #666666;
  font-size: 10px;
  font-weight: 650;
}

.intake-type-state.ready {
  color: var(--brand);
}

.intake-workspace {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-width: 0;
  border: 1px solid #363636;
  background: #101010;
}

.intake-requirement-rail {
  min-width: 0;
  padding: 24px 20px;
  border-right: 1px solid #303030;
  background: #0c0c0c;
}

.intake-requirement-rail h3 {
  margin-top: 8px;
  font-size: 19px;
}

.intake-requirement-rail > p {
  margin-top: 9px;
}

.intake-requirement-rail ul {
  display: grid;
  gap: 0;
  margin: 22px 0 0;
  padding: 0;
  border-top: 1px solid #2c2c2c;
  list-style: none;
}

.intake-requirement-rail li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border-bottom: 1px solid #272727;
}

.intake-requirement-rail li span {
  color: var(--brand);
  font-size: 9px;
  font-weight: 750;
}

.intake-requirement-rail li.recommended span {
  color: #7f7f7f;
}

.intake-requirement-rail li strong {
  color: #b8b8b8;
  font-size: 11px;
  font-weight: 590;
  line-height: 1.45;
}

.intake-prototype-note {
  margin-top: 20px;
  padding: 14px;
  border-left: 2px solid #555555;
  background: #141414;
}

.intake-prototype-note strong {
  color: #bdbdbd;
  font-size: 11px;
  font-weight: 650;
}

.intake-prototype-note p {
  margin: 5px 0 0;
  color: #707070;
  font-size: 10px;
  line-height: 1.6;
}

.intake-main {
  min-width: 0;
}

.intake-main-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
  padding: 18px 22px;
  border-bottom: 1px solid #303030;
}

.intake-main-heading > div:first-child {
  display: grid;
  gap: 5px;
}

.intake-main-heading h3 {
  font-size: 19px;
}

.intake-method-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(360px, 100%);
  border: 1px solid #3a3a3a;
}

.intake-method-switch button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid #333333;
  border-radius: 0;
  background: #121212;
  color: #777777;
  font-size: 11px;
  font-weight: 620;
  cursor: pointer;
}

.intake-method-switch button:last-child {
  border-right: 0;
}

.intake-method-switch button:hover,
.intake-method-switch button:focus-visible {
  color: #d7d7d7;
}

.intake-method-switch button:focus-visible {
  outline: 1px solid #666666;
  outline-offset: -3px;
}

.intake-method-switch button.active {
  background: #eeeeee;
  color: #101010;
}

.intake-method-panel {
  min-width: 0;
}

.intake-form-section {
  padding: 24px 22px 26px;
  border-bottom: 1px solid #303030;
}

.intake-form-section > header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.intake-form-section > header > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #483333;
  background: #1b1414;
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
}

.intake-form-section h4,
.intake-mcp-intro h4 {
  margin: 0 0 4px;
  color: #e7e7e7;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 620;
}

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

.intake-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.intake-field-wide {
  grid-column: 1 / -1;
}

.intake-field > span,
.intake-materials > span,
.intake-visibility legend {
  color: #a8a8a8;
  font-size: 11px;
  font-weight: 620;
}

.intake-field > span b {
  margin-left: 5px;
  color: var(--brand);
  font-size: 9px;
  font-weight: 700;
}

.intake-field input,
.intake-field select,
.intake-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #353535;
  border-radius: 0;
  background: #0c0c0c;
  color: #dedede;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  outline: 0;
}

.intake-field input,
.intake-field select {
  min-height: 42px;
  padding: 0 12px;
}

.intake-field textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
}

.intake-field textarea.intake-textarea-tall {
  min-height: 128px;
}

.intake-field input::placeholder,
.intake-field textarea::placeholder {
  color: #555555;
}

.intake-field input:focus,
.intake-field select:focus,
.intake-field textarea:focus {
  border-color: #707070;
  box-shadow: 0 0 0 1px #707070;
}

.intake-field.is-invalid input,
.intake-field.is-invalid textarea {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px rgb(255 77 77 / 35%);
}

.intake-materials {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.intake-material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #313131;
}

.intake-material-grid label {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border-right: 1px solid #292929;
  border-bottom: 1px solid #292929;
  background: #0e0e0e;
  color: #8e8e8e;
  font-size: 10px;
  cursor: pointer;
}

.intake-material-grid label:nth-child(3n) {
  border-right: 0;
}

.intake-material-grid label:nth-child(n + 4) {
  border-bottom: 0;
}

.intake-material-grid input,
.intake-visibility input {
  accent-color: var(--brand);
}

.intake-upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  border: 1px solid #343434;
}

.intake-dropzone {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 3px 12px;
  min-height: 126px;
  align-content: center;
  padding: 20px;
  border-right: 1px dashed #3b3b3b;
  background: #0d0d0d;
  cursor: pointer;
}

.intake-dropzone:hover,
.intake-dropzone:focus-within {
  background: #131313;
}

.intake-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.intake-dropzone-mark {
  display: grid;
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #4b3737;
  background: #1c1515;
  color: var(--brand);
  font-size: 19px;
  font-weight: 400;
}

.intake-dropzone strong {
  color: #d7d7d7;
  font-size: 12px;
  font-weight: 650;
}

.intake-dropzone small {
  color: #737373;
  font-size: 10px;
  line-height: 1.55;
}

.intake-file-summary {
  min-width: 0;
  padding: 18px;
  background: #101010;
}

.intake-file-summary ul {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.intake-file-summary li {
  overflow: hidden;
  color: #888888;
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intake-visibility {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 0;
  padding: 0;
  border: 1px solid #343434;
}

.intake-visibility legend {
  margin-left: 12px;
  padding: 0 6px;
}

.intake-visibility label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  min-height: 74px;
  align-items: center;
  padding: 12px;
  border-right: 1px solid #292929;
  cursor: pointer;
}

.intake-visibility label:last-child {
  border-right: 0;
}

.intake-visibility label > span {
  display: grid;
  gap: 3px;
}

.intake-visibility strong {
  color: #bfbfbf;
  font-size: 11px;
  font-weight: 620;
}

.intake-visibility small {
  color: #686868;
  font-size: 9px;
  line-height: 1.45;
}

.intake-mcp-panel {
  padding: 28px 22px;
}

.intake-mcp-intro {
  max-width: 720px;
}

.intake-mcp-intro h4 {
  margin-top: 8px;
  font-size: 23px;
}

.intake-mcp-intro p {
  font-size: 13px;
}

.intake-mcp-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0 0;
  padding: 0;
  border: 1px solid #343434;
  list-style: none;
}

.intake-mcp-flow li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  min-height: 126px;
  align-content: start;
  padding: 18px;
  border-right: 1px solid #2d2d2d;
  background: #111111;
}

.intake-mcp-flow li:last-child {
  border-right: 0;
}

.intake-mcp-flow li > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #483333;
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
}

.intake-mcp-flow strong,
.intake-mcp-imports strong {
  display: block;
  margin-bottom: 5px;
  color: #cfcfcf;
  font-size: 11px;
  font-weight: 620;
}

.intake-mcp-imports {
  display: grid;
  grid-template-columns: 126px repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border: 1px solid #343434;
}

.intake-mcp-imports > span,
.intake-mcp-imports > div {
  display: grid;
  align-content: center;
  min-height: 88px;
  padding: 14px;
  border-right: 1px solid #2b2b2b;
}

.intake-mcp-imports > div:last-child {
  border-right: 0;
}

.intake-mcp-imports small {
  color: #707070;
  font-size: 9px;
  line-height: 1.5;
}

.intake-mcp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.intake-coming-soon {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 170px;
  padding: 26px;
  border: 1px solid #343434;
  background:
    linear-gradient(110deg, rgb(255 77 77 / 7%), transparent 50%),
    #111111;
}

.intake-coming-soon > .intake-type-code {
  width: 48px;
  height: 48px;
}

.intake-coming-soon h3 {
  margin: 6px 0 6px;
  font-size: 20px;
}

.intake-review {
  padding: 16px 18px;
  border: 1px solid #4a4a4a;
  background: #141414;
}

.intake-review.has-errors {
  border-color: #713c3c;
  background: #1a1212;
}

.intake-review.ready {
  border-color: #3f5b49;
  background: #101813;
}

.intake-review strong {
  display: block;
  margin-bottom: 4px;
  color: #dedede;
  font-size: 12px;
  font-weight: 650;
}

.intake-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 -28px -28px;
  padding: 16px 28px;
  border-top: 1px solid #383838;
  background: rgb(13 13 13 / 96%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.intake-actions > p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.intake-actions > p strong {
  color: #bdbdbd;
  font-size: 10px;
  font-weight: 650;
}

.intake-actions > p span {
  color: #666666;
  font-size: 9px;
}

.intake-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
}

.intake-actions .button,
.intake-mcp-actions .button,
.intake-coming-soon .button {
  min-height: 40px;
  padding-inline: 15px;
  font-size: 11px;
}

.asset-intake [hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .portal-dialog[data-mode="intake"] {
    width: calc(100vw - 28px);
  }

  .intake-overview {
    grid-template-columns: 1fr;
  }

  .intake-stage-line {
    border-top: 1px solid #2f2f2f;
    border-left: 0;
  }

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

  .intake-type-option:nth-child(2) {
    border-right: 0;
  }

  .intake-type-option:nth-child(-n + 2) {
    border-bottom: 1px solid #2d2d2d;
  }

  .intake-workspace {
    grid-template-columns: 1fr;
  }

  .intake-requirement-rail {
    border-right: 0;
    border-bottom: 1px solid #303030;
  }

  .intake-requirement-rail ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .intake-requirement-rail li:nth-child(odd) {
    padding-right: 12px;
    border-right: 1px solid #272727;
  }

  .intake-prototype-note {
    max-width: 560px;
  }

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

  .intake-mcp-imports > span {
    grid-column: 1 / -1;
  }

  .intake-mcp-imports > span,
  .intake-mcp-imports > div {
    border-right: 1px solid #2b2b2b;
    border-bottom: 1px solid #2b2b2b;
  }
}

@media (max-width: 720px) {
  .portal-dialog[data-mode="intake"] {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
  }

  .portal-dialog[data-mode="intake"] .portal-dialog-shell {
    max-height: calc(100vh - 16px);
  }

  .portal-dialog[data-mode="intake"] .portal-dialog-header {
    padding: 15px 14px;
  }

  .portal-dialog[data-mode="intake"] .portal-dialog-header h2 {
    font-size: 20px;
  }

  .portal-dialog[data-mode="intake"] .portal-dialog-body {
    padding: 0 14px 18px;
  }

  .asset-intake {
    gap: 22px;
  }

  .intake-overview > div {
    padding: 22px 18px;
  }

  .intake-overview h3 {
    font-size: 25px;
  }

  .intake-stage-line li {
    min-height: 76px;
    padding: 14px 10px;
  }

  .intake-stage-line strong {
    font-size: 10px;
  }

  .intake-section-heading {
    display: grid;
    gap: 10px;
  }

  .intake-section-heading > p {
    padding-left: 0;
    border-left: 0;
  }

  .intake-type-option {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 136px;
    padding: 14px;
  }

  .intake-type-code {
    width: 34px;
    height: 34px;
  }

  .intake-type-copy strong {
    font-size: 13px;
  }

  .intake-requirement-rail {
    padding: 20px 16px;
  }

  .intake-requirement-rail ul {
    grid-template-columns: 1fr;
  }

  .intake-requirement-rail li:nth-child(odd) {
    padding-right: 0;
    border-right: 0;
  }

  .intake-main-heading {
    display: grid;
    min-height: 0;
    padding: 18px 16px;
  }

  .intake-method-switch {
    width: 100%;
  }

  .intake-form-section {
    padding: 22px 16px;
  }

  .intake-field-grid {
    grid-template-columns: 1fr;
  }

  .intake-field-wide {
    grid-column: auto;
  }

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

  .intake-material-grid label:nth-child(3n) {
    border-right: 1px solid #292929;
  }

  .intake-material-grid label:nth-child(even) {
    border-right: 0;
  }

  .intake-material-grid label:nth-child(n + 4) {
    border-bottom: 1px solid #292929;
  }

  .intake-material-grid label:nth-child(n + 5) {
    border-bottom: 0;
  }

  .intake-upload-layout {
    grid-template-columns: 1fr;
  }

  .intake-dropzone {
    border-right: 0;
    border-bottom: 1px dashed #3b3b3b;
  }

  .intake-visibility {
    grid-template-columns: 1fr;
  }

  .intake-visibility label {
    min-height: 62px;
    border-right: 0;
    border-bottom: 1px solid #292929;
  }

  .intake-visibility label:last-child {
    border-bottom: 0;
  }

  .intake-mcp-panel {
    padding: 22px 16px;
  }

  .intake-mcp-flow {
    grid-template-columns: 1fr;
  }

  .intake-mcp-flow li {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid #2d2d2d;
  }

  .intake-mcp-flow li:last-child {
    border-bottom: 0;
  }

  .intake-mcp-imports {
    grid-template-columns: 1fr;
  }

  .intake-mcp-imports > span {
    grid-column: auto;
  }

  .intake-coming-soon {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 20px 16px;
  }

  .intake-coming-soon > .button {
    grid-column: 1 / -1;
  }

  .intake-actions {
    bottom: 0;
    display: grid;
    margin: 0 -14px -18px;
    padding: 14px;
  }

  .intake-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .intake-actions [data-review-intake] {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intake-type-option,
  .intake-type-option::before {
    transition: none;
  }
}
